Thursday, 15 April 2010

dhtml - how to make use of the jquery call back method -


I'm trying to display the feedback by using jquery within a pop up with an AJAX call I do not know how to use the callback method correctly, shown below

Many thanks

  var data = "to post my data "; .loadAjaxWindow (url, jr.dialog (data), true, function (xhr, textstatus, errorThrown) {// stuff}, true, 'post', data);   

The method looks like the following:

  // Ajax method loadAjaxWindow: function (URL, callback, async, error block, cache, type, data) {Success: functions (data, textstats, xhur) {callback (data); },}   

I have tried the following though the alert is not shown?

  var myCallBack = function (obj) {warning (""); }; .jax.loadJson (url, myCallback, true, function (xhr, textstatus, errorThrown) {// stuff}, true, 'post', JSON.stringify (data));    

Callback is a function here, which is called the success of Ajax Callback ...

Then as an example ..

  var callback = function (obj) {console.log (obj); Jr.dialog (obj) // junior ?? // Do your staff with AJAX, who have returned as OBJE); LoadAjaxWindow: Function (URL, callback, async, error block, cache, type, data) {success: function (data, textstats, exposure) {callback (data); },}   

So if you check in your console it will return by AJAX call.

No comments:

Post a Comment