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

  1. assuming 1:1 code have, add
  2. install or use firebug view request made. check address it's right.
  3. make sure controller action works intended. return valid json-response.

that's as can without more info.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -