location.search for GET URL only?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mark Anderson

    #1

    location.search for GET URL only?

    Am I correct in thinking that you can only use location.search to retrieve
    all a form's inputs if the method is GET. In my experiments so far, using
    search I only get what follows the ? in the returned page. With the
    'script' I'm using that gives me nothing in the URL with POST.

    I hope that makes sense. Am I missing something?

    Mark


  • Michael Winter

    #2
    Re: location.search for GET URL only?

    On Tue, 20 Jan 2004 00:12:13 -0000, Mark Anderson
    <mark@notmeyear dley.demon.co.u k> wrote:
    [color=blue]
    > Am I correct in thinking that you can only use location.search to
    > retrieve all a form's inputs if the method is GET. In my
    > experiments so far, using search I only get what follows the ? in
    > the returned page. With the 'script' I'm using that gives me
    > nothing in the URL with POST.[/color]

    Location.search isn't specific to form submittal. It simply returns a
    string containing everything in the URI associated with the Location
    object from the question mark (?) onwards.

    The GET submission method passes data using the URL. The POST method uses
    HTTP headers[1].

    There is no way for JavaScript to access POST data directly.

    Mike


    [1] If I remember correctly.

    --
    Michael Winter
    M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    Working...