简体   繁体   English

IE 中的 Javascript 问题,但不是 FF、Chrome 或 Safari

[英]Javascript problems in IE, but not FF, Chrome, or Safari

I'm getting tired of trying to debug in IE 7, It won't let me install IE8 because I'm running vista.我已经厌倦了尝试在 IE 7 中调试,它不会让我安装 IE8,因为我正在运行 vista。 So if someone could help me out that would be great.因此,如果有人可以帮助我,那就太好了。

http://1searchengine.com 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.删除 scripts.js 文件中第 117 行末尾的逗号 (,)。 The JS parser of IE can't run that well with dynamic endings like that. IE 的 JS 解析器不能在这样的动态结尾很好地运行。 FF eand CHrome + IE8+ can. FF eand CHrome + IE8+ 都可以。 That's why the error pops up at IE7.这就是为什么在 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我发现了一些在 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.文件 src.php 中也有错误,您使用 GET 键 => 类型,值 => 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至少应该有数组参数的结尾“] end the closuer of the places object } + eng.yahoo object } 的结尾。所以它应该看起来像这样

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.确保您的 PHP 代码与正确的部分相呼应。 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.比第 168 行的 scripts.js 中的另一个错误。您对变量的类型进行检查。 However this is not possible with the IE JS parser if the object is not knwon.但是,如果不知道 object,则使用 IE JS 解析器是不可能的。 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.我知道这有点牵强,可能有些矫枉过正,但它会解决 IE7- 与未定义的 JS 变量有关的问题。 If the e.languages.== undefined && e,languages.== null doesn't work.如果 e.languages.== undefined && e,languages.== null 不起作用。 trye e.languages != 'undefined' && e.languages != 'null'.尝试 e.languages != 'undefined' && e.languages != 'null'。

I could not find a fix for the class error for now.我暂时找不到 class 错误的修复程序。 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.但是,当其他错误消失时,它可能会被修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Javascript适用于FF / IE,但不适用于Chrome / Safari - Javascript works in FF / IE but not Chrome / Safari 我的 Javascript 适用于 IE FF 和 Safari,但不适用于 Chrome - My Javascript works on IE FF & Safari, but not Chrome Javascript函数可在IE中运行,但不能在FF,Chrome或Mobile Safari中运行 - Javascript functions working in IE but not in FF, Chrome, or Mobile Safari Javascript在Chrome上有效,但在IE或FF上无效 - Javascript works on Chrome, but no on IE or FF JQuery - Chrome 中的背景图像旋转问题(仅在 F5 刷新后有效)。 在 FF、Safari、IE 中没有问题 - JQuery - Background image rotation issues in Chrome (works only after F5 refresh). No problems in FF, Safari, IE Javascript在IE中调用,但不在Chrome和FF中调用 - Javascript is called in IE but not in Chrome and FF JavaScript适用于IE + Chrome,但不适用于FF - JavaScript works in IE + Chrome but not FF 在IE6 +,FF和Safari的JavaScript中添加到收藏夹 - Add to favorites in JavaScript for IE6+, FF and Safari javascript FF / Safari中的xa保留关键字不在IE中吗? - Is x a reserved keyword in Javascript FF/Safari not in IE? JavaScript commit(); Mac的IE / Safari / FF中出现问题 - JavaScript submit(); problem in IE / Safari / FF for Mac
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM