Jump to content

ajax noob- php and ajax. my problem is..


the 7th Hokage

Recommended Posts

I've been working on a browser based web game for people to play. i am 80% done. The site was done in PHP and I am to the point where i need to make a connection between client and server side languages. my problem is this.

 

I have a page where i need output printed to the page without it refreshing, but that's not the main thing. I am using PHP objects loaded with data from the server, this cuts down on loading time for me I want to keep this objectivity. "however" i used javascript to update the page by adding text nodes. My problem with that is i can't call php functions in jscript.  I was told this could be done by AJAX(call php functions from the ajax language).

 

I have no idea how to proceed with doing what i need after reading serveral articles and a few tutorials on AJAX. I get the basics but honestly I'm just a bit lost..

 

i have included pictures so you can understand what i mean.

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

your best bet is to download jQuery and to use that. 

 

the basics of what you would have then, is a front end page with your javascript and a few empty divs.  you would also have a backend page with all of your php code.  your jquery would take input from the main page, send it to the backend which would then output data in the divs without ever having to refresh

 

jQuery seems complicated to use at first, but once you get used to it, its extremely powerful

 

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.