search query to google as <iframe> source

Discussion in 'JavaScript' started by vHTML, Jan 13, 2007.

  1. #1
    hello everyone :)

    I am trying to make a page which would take a "entered" on search query from the previous page and display results in google with that query in an <iframe> in the results.htm page.

    So if I enter the word "watches" into a textbox, the google search results would be displayed in an <iframe> in the results.htm page for the word "watches" with something like "google.com/search?q=" for "textValue".

    I have did set up a demo, but was having all kinds of problem s with displaying the appropriate query in an <iframe>, so at the moment the results page is without any iframes.

    here is the demo - "scratchpad.50webs.com/iframe"

    I tried all sorts of stuff, played around with javascript, but nothing. Scanned a million forums through google, but still nothing.

    How can I make the <iframe> on the "results.htm" page to display the google search for the entered word, automatically when the page loads, and still have the textbox on results.htm fill up with the passed textbox value from the first page?

    thanks a bunch!!
    vHTML
     
    vHTML, Jan 13, 2007 IP
  2. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #2
    hmm, i would take a look at google's querystrings they use... then Serverside find the querystring, and pass that into a Client-Side Javascript variable in the body onload event. Then it calls to execute the iframed page's location using the main page's querystring value.
     
    ccoonen, Jan 13, 2007 IP
  3. vHTML

    vHTML Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hey thanks for replyin,

    but I'm really really not a pro in javascript!

    If you could tell me what codes to use for the <iframe> along with body onload?

    thanks once again.
    v
     
    vHTML, Jan 14, 2007 IP