html - Browser compatibility between IE6 and IE7 -
I'm developing a project in which I flag I need to change the language by clicking using AJAX . It's working fine in IE7 but when I run it in IE6, it shows an error.
& lt; Html & gt; & Lt; Top & gt; & Lt; Script type = "text / javascript" src = "http://www.google.com/jsapi" & gt; & Lt; / Script & gt; & Lt; Script language = "javascript" & gt; Google.load ("Language", "1"); Function Funrrons (Stronton Text, Stratransfiled, Stratensflank, Stratenselag) {google.language.translate (strTransText, strTransFLang, strTransTLang, function (results) {var strcontainer = document.getElementById (strTransField); strcontainer.innerHTML = result.translation;}) ; } Functional initialization (strtoxtbox, strfmtexbox) {var x = window.location.toString (); Var strLang = x.substring (x.indexOf ("=") + 1); If ((x.indexOf ("=")) == - 1) Return; StrFLang = strLang.substring (0,2) strTLang = strLang.substring (strLang.indexOf ("-") + 1); Var strText = document.getElementById (strFromTxtBox). WinnerHTML; If (strFLang = 'N'!) FnTrans (strText, strFromTxtBox, 'en', strFLang) fnTrans (strText, strToTxtBox, strFLang, strTLang)} function fnhi () {var label = document.getElementsByTagName ( "labels"); Var count = label. Lamb; Var x = window.location.toString (); Var strLang = x.substring (x.indexOf ("=") + 1); If ((x.indexOf ("=")) == - 1) Return; For (var i = 0; i
This is what I'm not clear that the question is so I'm guessing. If you want to do something depending on the JavaScript browser, you can ask which browser request has been sent.
& lt; Html & gt; & Lt; Body & gt; & Lt; Script type = "text / javascript" & gt; Var Browser = Navigator.appName; Var b_version = navigator.app version; Var version = parFlot (b_version); Document.write ("Browser Name:" + Browser); Document.write ("& lt; br / & gt;"); Document.write ("Browser version:" version +); & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt; Then by adding the "if" statement you can customize the browser depending on the browser. Anyway I do not have the advice to do this because you have to maintain your code for all browsers. In addition, you have tested different browsers and browser versions.
A possible solution you use some javascript libraries which are crossbrowser like GWT from Google.
Louis
Comments
Post a Comment