SPUG: Ajax question - js args
ghawk at eskimo.com
Tue Jun 20 00:58:06 PDT 2006
I'm working with Ajax and have a real basic question. Meanwhile I'm going to
show what I'm doing in this Ajax example, because surely there will be
/(people)+/ that will find it intriguing or useful.
My question is simply: How do I assign input arguments that are passed to a
.js file to variables in the js code? That's new to me, I think I've read ~ 42
million web pages looking for that simple building block, and no joy.
Here's the example: http://www.eskimo.com/~ghawk/ajax/test.htm
Once on the page, you'll see a little "rotating" animated gif while the
external page/information is being read. The Perl script triggered by the js
code is looking for the number of sellers on this page:
?s=dvd&v=glance&n=130> .where it says something like
4922?%5Fencoding=UTF8> 56 used & new (the number changes of course).
Once Perl has retrieved that page and extracted the number, it is returned to
the package has arrived, updates the div (id is 'display') and places the
digits there, replacing the image.
...and that ASIN (Amazon Standard Identification Number) is different than the
one hardcoded (or medium coded) into the .cgi file. Now all I have to do is
persuade js to take in that arg so it can be handed over to the Perl script.
In short, I need the js
equivalent+of+ at ARGV> equivalent of @ARGV.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the spug-list