php - Script not working on Internet Explorer only? -


i have function in 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=';  } 

so when call function responds in google chrome,firefox , modern browsers not internet explorer.

can of modify code accordingly ?

thanking you.

works me - ie8

<html>   <head>   <title></title> <script> function bingframe(theform) {   var iframe = document.getelementbyid('bframe');   var url = 'http://www.bing.com/search?q=' + escape(theform.search.value).replace(/ /g,'+') + '&go=&form=qblh&filt=all&qs=n&sk=';   iframe.src = url;    return false } window.onload=function() {   document.forms[0].search.focus(); } </script> </head> <body> <form name="searchform" onsubmit="return bingframe(this)"> <input type="text" name="search" value="" /> <input type="submit"> </form> <iframe id="bframe" src="about:blank" width="100%" height="100%"></iframe> </body> </html> 

however - no script necessary:

<html> <head> <title></title> <script> window.onload=function() {   document.forms[0].q.focus(); } </script> </head> <body> <form name="searchform" action="http://www.bing.com/search" target="bframe"> <input type="text" name="q" value="" /> <input type="hidden" name="go" value="" /> <input type="hidden" name="form" value="qblh" /> <input type="hidden" name="filt" value="all" /> <input type="hidden" name="qs" value="n" /> <input type="hidden" name="sk" value="" /> <input type="submit"> </form> <iframe name="bframe" src="about:blank" width="100%" height="100%"></iframe> </body> </html> 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -