Js->request wrong url formating
I'm learning how to use the new Js helper for an ajax task.
Here is my php code:
echo $this->Js->get('#all')->event('change', $this->Js->request(array('controller' => 'keywords' , 'action' => 'ajax'),$options));
and this is the generated javascript:
<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {$("#all").bind("change", function (event) {$.ajax({async:true, dataType:"html", success:function (data, textStatus) {$("#box").html(data);}, url:"\/bma\/keywords\/ajax"});
return false;});});
//]]>
</script>
Look at the url, it is wrong, even if I input it directly ("http://example.com/bma/keywords/ajax") the slashbars get "scaped". I took a look in the request function from the jquery_engine.php but I was not able to fix the issue.
Asked by Lobosque, on 8/3/10
1 Answer
The 'scaped url should work anyway. Taking it yours isn't - did you remember to set debugging to 0 in your controller or config?
Answered by satyrwilderon 15/5/10
Your Answer
You can use Creole Wiki Syntax to format your text.
Tagged with
Rating
0
Viewed
367 times
Last Activity
on 15/5/10