Script Source Options

Discussion in 'Javascript' started by Bryan, Oct 14, 2006.

  1. Bryan

    Bryan Guest

    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!
     
    Bryan, Oct 14, 2006
    #1
    1. Advertising

  2. Bryan

    Danny Guest

    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
     
    Danny, Oct 14, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cliff  Martin
    Replies:
    1
    Views:
    3,042
    Larry Smith
    Jan 31, 2007
  2. jacksu
    Replies:
    0
    Views:
    511
    jacksu
    Oct 9, 2007
  3. Utkado
    Replies:
    2
    Views:
    2,118
  4. Bryan Richardson
    Replies:
    6
    Views:
    289
    Bryan Richardson
    Feb 25, 2008
  5. Sijo Kg
    Replies:
    1
    Views:
    102
    Justin Collins
    Jan 7, 2009
Loading...

Share This Page