Jump to content

verifying a notion


simpli

Recommended Posts

Hi,

I haven't started ajax yet but I have been reading books while in the meantime dusting off my js and php. I have a question which pertains with what I'm going to try to achieve later. Ajax is good to retrieve stuff from the server while providing desktop like response. But what if what I want to do is on the server side? For instance when i click a button on the client side, i want a row to be added to a table on the server side? How can I do that? There is nothing in the js that allows me to start such a thing from the client side. Or is it through the php file I call with the XHR that I can get whatever done on the server side?

 

If so, if the row is added, the XHR will not really be returning anything so what signal do I have that the table was indeed added to the table?

 

Thanks for clarifying

J-R

Link to comment
Share on other sites

Hi,

I haven't started ajax yet but I have been reading books while in the meantime dusting off my js and php. I have a question which pertains with what I'm going to try to achieve later. Ajax is good to retrieve stuff from the server while providing desktop like response. But what if what I want to do is on the server side? For instance when i click a button on the client side, i want a row to be added to a table on the server side? How can I do that? There is nothing in the js that allows me to start such a thing from the client side. Or is it through the php file I call with the XHR that I can get whatever done on the server side?

Yeah buddy, you are right. We call the PHP file through XHR which gets the job done.

 

If so, if the row is added, the XHR will not really be returning anything so what signal do I have that the table was indeed added to the table?

 

You could indeed echo "Success"; in the php file if the table row gets added. Then you can display the result from the PHP file which is "Success" in the HTML document.

 

Hope you got my point.

Link to comment
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.