Re: [PHP] JS prompt -> php



At 5:11 AM -0800 2/7/07, Ryan A wrote:
Hey all!

Quick question (and hopefully a simple one)

I have a link on a page, when the client clicks that link it should show them a JS prompt and ask for their name (so far I have done this)

When they write their name, I want that data to be sent to my php script via AJAX (yes?) so the page does not reload or anything.... (actually, how can i reload the page to reflect the change?)

I have googled but I see whole ajax classes and what not, I dont know if I am using the correct keywords or what... you would happen to have a working piece of code that you could share with me.. would you?

Thanks!
Ryan

Ryan:

Your terminology is clear enough and you're on the right path, but it's not simple.

The way it works is that you have a javascript ajax file, which is loaded by your main page and creates a request object. When the user clicks something, it receives a send request, and handles the response, which in turn updates the page via the DOM without a refresh. Clear?

Keep looking at ajax.

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
.



Relevant Pages

  • Re: Changing the address bar without loading a page
    ...  Don't break navigation. ... Changing the hash requires reloading the page and directly defeats one ... of the purposes of AJAX. ... If you are going to reload the page anyway, ...
    (comp.lang.javascript)
  • Re: JS prompt -> php
    ... script via AJAX so the page does not reload or anything.... ... I have googled but I see whole ajax classes and what not, ... javascript commands to store this value in a cookie. ... sent automatically to your PHP script the next time a user requests a ...
    (php.general)
  • Re: hey everyone
    ... AJAX would be good, but it just uses Javascript, right? ... it's a bit smoother than triggering a reload automatically ... re-rendering the whole page, and instead only re-render the portions which ...
    (comp.lang.java.programmer)
  • Re: Changing the address bar without loading a page
    ... Don't muck with them. ... add weird hashes onto the end of it to save state. ... If you are going to reload the page anyway, you may as well skip AJAX, just reload the page, and get the data from the server. ...
    (comp.lang.javascript)
  • Re: [PHP] JS prompt -> php
    ... I want to do this via a javascript prompt, which is where I am getting stumped. ... script via AJAX so the page does not reload or anything.... ... loaded by your main page and creates a request object. ...
    (php.general)