Script Source Options

B

Bryan

Hello all,

I'm just curious about something and I knew someone here would have the
answer! :)

I notice when I view the source of a lot of Google pages (for example,
my GMail Inbox page source) that the src option in <script> tags will
refer to addresses like "?foo=bar&bla=bla". How does this work
exactly? Does the server side script return a string containing
javascript code? How does it know which server side script to call?
Does it look for an index file of some type?

Something else I just noticed in the address of this page (I know this
is off topic, sorry)... this page sends GET data to a "place" named
'post', but 'post' has no file extension. How does this work?

Thanks!
 
D

Danny

Yes, it makes a webserver request on the SRC= and the request is the string, the webserver gets
it on its HTTP headers for it, and processes the string, most often an absolute path to the
actual filesystem file entry will be used in the URI, but the webserver processes the string,
if it's an absolute URI, it handles it like so, by attempting to serve the file after checking
permissions and such. In this case, the string is a URI to a script with some
arguments/parameters, the webserver processes, gives to foo.php and if ?blah=my%20sharona is
there, once in the foo.php script scope, the variable $_GET['blah'] will have the value 'my
sharona' and the script takes it from there, does some, IF/ELSE and other checks, and in the
end, it returns a valid request, in this case, ASCII string for the <script> element, it can be
done by echo() ing it out, or by after many rundowns/checks, fetching a file. The script
serves as a "REQUEST BROKER" sorta speak :), but it returns in the end, a valid request, same
can be applied to any attribute that uses an URI.

Danny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top