Jump to content

spot of ajax help


radar

Recommended Posts

Okay so I have this function in javascript which has some ajax in it..

 

function saveChanges(obj){

var new_content	=  escape($F(obj.id+'_edit'));

obj.innerHTML	= "Saving...";
cleanUp(obj, true);

var success	= function(t){editComplete(t, obj);}
var failure	= function(t){editFailed(t, obj);}

  	var url = 'index.php?action=about&act=save';
var pars = 'id='+obj.id+'&content='+new_content;
var myAjax = new Ajax.Request(url, {method:'post', postBody:pars, onSuccess:success, onFailure:failure});

}

 

the var url is the issue i am having an issue with...  if i have it as edit.php (i created the file) it works perfect, though when i have it as in the code above, it stays on "saving..." doesn't do any updating...

 

i would rather keep all of my logic in a single file instead of having to have an edit.php to complete the saving portion of this -- any clue how to do this?

Link to comment
https://forums.phpfreaks.com/topic/51776-spot-of-ajax-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.