开发者

ajax jquery won't pass the string to the task function?

I'm trying to make a joomla component and I would like to use it the given possibilities from ajax jquery. The tas开发者_StackOverflow中文版k would be to make threw ajax querys from database and to output the result.

to send the data I'm using the following javascript

$(".searchBtn").click(function(){

       $('.default_order').hide();

    //show the loading bar

    showLoader();

    $('#sub_cont').fadeIn(1500);



    $("#content #sub_cont").load("?option=com_glossary&task=displayvalues&format=raw?val="+ $("#search").val(), hideLoader());



});

what actually should send a variable in string form to my controller, but when I'm checking if the variable existing or not doesn't output anything

     public function getvalues(){

         $rec = $this->checkValues(JRequest::getVar('val'));
         echo $rec;

}

every comment would help thank you


I assume it's this:

...&format=raw?val=" + ...

Shouldn't this be

...&format=raw&val=" + ...

? I would also suggest to serialize the contents of #search otherwise you could get in trouble with URL encoding:

..." + $("#search").serialize(), ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜