开发者

Javascript problems in IE, but not FF, Chrome, or Safari

开发者 https://www.devze.com 2023-03-10 18:56 出处:网络
I\'m getting tired of trying to debug in IE 7, It won\'t let me install IE8 because I\'m running vista. 开发者_StackOverflow社区So if someone could help me out that would be great.

I'm getting tired of trying to debug in IE 7, It won't let me install IE8 because I'm running vista. 开发者_StackOverflow社区So if someone could help me out that would be great.

http://1searchengine.com

The main issue seems to be the 'class' undefined error.


Delete the comma (,) ad the end of line 117 in the scripts.js file. The JS parser of IE can't run that well with dynamic endings like that. FF eand CHrome + IE8+ can. That's why the error pops up at IE7. Nice site by the way.

"height": idxLogoSmall[1],

Should become

"height": idxLogoSmall[1]


I found a couple of errors that keeps coming back in IE7

The fix for the shadowbox warning, uncomment this line

<!--<script src="http://1searchengine.com/js/shadowbox.js" type="text/javascript"></script>-->

in the index file.

There is also a error in the file src.php with you request with the GET key => type, value => web. When i look at the source of the file, I see quet a blank where there should be more information.

eng.yahoo = {
pageTitle: "Yahoo",
logo: "yahoo.jpg",
places: {
    'Yahoo' : ["http://search.yahoo.com/search;_ylt=AvB2w_TBUu6j0351jgYdrtObvZx4?p=%query%&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701"],
    'Images' : ["http://images.search.yahoo.com/search/images;_ylt=A2KJkIXjE7dNiWMA0KKJzbkF?p=%query%&fr=yfp-t-701&ei=utf-8&x=wrt&y=Search"],
    'Videos' : ["http://video.search.yahoo.com/search/video;_ylt=A2KJkIUmFLdNqmcA6XqJzbkF?ei=UTF-8&p=%query%&y=Search&fr2=tab-img&fr=yfp-t-701"],
    'Maps'   : ["http://maps.yahoo.com/#mvt=m&tp=1&
// From this point on code is missing.

There should be at least the end of the array argument "] end the closuer of the places object } + the closue of the eng.yahoo object }. So it should look something like this

eng.yahoo = {
pageTitle: "Yahoo",
logo: "yahoo.jpg",
places: {
    'Yahoo' : ["http://search.yahoo.com/search;_ylt=AvB2w_TBUu6j0351jgYdrtObvZx4?p=%query%&toggle=1&cop=mss&ei=UTF-8&fr=yfp-t-701"],
    'Images' : ["http://images.search.yahoo.com/search/images;_ylt=A2KJkIXjE7dNiWMA0KKJzbkF?p=%query%&fr=yfp-t-701&ei=utf-8&x=wrt&y=Search"],
    'Videos' : ["http://video.search.yahoo.com/search/video;_ylt=A2KJkIUmFLdNqmcA6XqJzbkF?ei=UTF-8&p=%query%&y=Search&fr2=tab-img&fr=yfp-t-701"],
    'Maps'   : ["http://maps.yahoo.com/#mvt=m&tp=1&"]
  }
}

Make sure your PHP code echoes the right parts. If your having trouble with it, include it in the question description and people can help with that.

Than the other error in scripts.js at line 168. You perform a check on the type of variable. However this is not possible with the IE JS parser if the object is not knwon. You have now:

if (typeof e.languages == "object") setLang(firstProp(e.languages));
else $("#lang").fadeOut(fadeDur);

Try this instead:

if (e.languages !== undefined && e.languages !== null && typeof e.languages == "object") setLang(firstProp(e.languages));
else $("#lang").fadeOut(fadeDur);

I known it's quite a stretch and propablly some overkill, but it will illiminate the problems IE7- has with undefined JS variables. If the e.languages !== undefined && e.languages !== null doesn't work, trye e.languages != 'undefined' && e.languages != 'null'.

I could not find a fix for the class error for now. That one keeps popping up. Because the file is minified is't hard to understand what it excatly should do. However it is possible it will be fixed when the other errors are out of the way.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号