Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.