passing data to the controller through ajax from view -
i have page
http://www.mysite.com/discusssion/name_of_topic/page:1
at click of button in view, want redirect param (i.e url) controller , fetch data. url is: http://www.mysite.com/discusssion/name_of_topic/page:2
i writing ajax function call controller , fetch data not working me. here ajax function
$("#loadbut").click(function() { $.ajax({ type: "post", url : "/discussion/"+$topic+"/page:2", data: data, datatype: "json", success: function (response) { if (response.success) { pr(data); exit(); } else { console.log(response.data, response.code); } } }); });'
how can make work, ideas??
few things try
- assuming 1:1 code have, add
- install or use firebug view request made. check address it's right.
- make sure controller action works intended. return valid json-response.
that's as can without more info.
Comments
Post a Comment