My Script doesn't work on IE ?

Discussion in 'JavaScript' started by i'm, Sep 5, 2010.

  1. #1
    Hello everyone,

    I have function like this in my header

    
    function bingframe() {
    
    var iframe = document.getElementById('bframe');
    iframe.src = 'http://www.bing.com/search?q=' + document.searchForm.search.value.replace(/ /g,'+') + '&go=&form=QBLH&filt=all&qs=n&sk=';
    
    }
    Code (markup):
    So now when i call this function it responds in Google Chrome,Firefox and the modern browsers but not Internet explorer.

    Can any of you modify the code accordingly ?

    Thanking You,
    I'm
     
    i'm, Sep 5, 2010 IP
  2. i'm

    i'm Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Any help ???
     
    i'm, Sep 14, 2010 IP
  3. HungryMinds

    HungryMinds Active Member

    Messages:
    216
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #3
    Hi!

    Try This Method:

    
    <script>
    function bingframe() {
    	document.bframe.location.href = "http://www.bing.com/search?q=" + document.searchForm.search.value.replace(/ /g,'+') + "&go=&form=QBLH&filt=all&qs=n&sk=";
    }
    </script>
    
    <body onLoad="bingframe();">
    <iframe name="bframe" width="100%" height="100%"></iframe>
    
    Code (markup):
    Working Perfect But This Command Is Getting Error: document.searchForm.search.value.replace(/ /g,'+')
    U Can Run Without This Command.
     
    HungryMinds, Sep 14, 2010 IP
  4. i'm

    i'm Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    So will this work perfeclty ? Thanks
     
    i'm, Sep 19, 2010 IP
  5. WWSD

    WWSD Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What error are you getting i'm in IE (check the error console)
     
    WWSD, Sep 19, 2010 IP