Posted by Jam Pa on 05/26/05 12:20
There is a simple, well known way to transmit data between javascript on a
page and the server. No page submits or loads, just call a js function.
Enter XMLHTTPREQUEST and AJAX!
http://en.wikipedia.org/wiki/AJAX&e=10313
http://developer.apple.com/internet/webcontent/xmlhttpreq.html
Paul <freelance@dezignage.net> wrote in
news:uALke.1471779$6l.530601@pd7tw2no:
> "Passing" variables from PHP to JavaScript is much easier than the
> other way around.
>
> ie: echo "<script type='text/javascript'>thisPage =
> '{$_SERVER['PHP_SELF']}';</script>";
>
> (very basic example).. but as soon as you're trying to pass variables
> from JavaScript to PHP it gets quite a bit more complicated. As far as
> I know, you will not be able to do it in any other way other than
> submitting the page with a form (hidden fields and what not) .. or
> through the URL .. (which can reveal data).
> Paul
>
> Tom Scales wrote:
>> I need a set of variables that I can access in both PHP and in
>> Javascript. There are just a few things I can do in one that I cannot
>> do in the other.
>>
Navigation:
[Reply to this message]
|