Tag: internet explorer 8

IE8 toggleClass无法正常工作

好吧,我有一个菜单,我希望有一个名为active的类,当它活跃时,显然。 要切换这个类我使用jQuery切换function,但它只是在js元素中激活它。 如果我检查dom元素,则从不设置此类。 但是我需要这个类,因为我的CSS样式。 我知道有很多关于toggleClass jQuery的主题,但它们不合适(至少我找不到合适的东西) 这里有一些代码: $(‘#menu’).on(‘click’, ‘.tab span’, function (e) { e.stopPropagation(); var $tab = $(this).parent(‘.tab’); $tab.siblings(‘.tab.active’).removeClass(‘active’); $tab.toggleClass(‘active’); }); HTML标记 它在所有浏览器中工作,IE8除外提前感谢。

jQuery追加function在Internet Explorer 8中不起作用

这是我的代码 – $(“body”).append(“” + “” + “” + “Add” + “” + “” + “Edit” + “” + “” + “Delete” + “” + “” + “”); 在IE8中我收到以下错误 – 网页错误详细信息 User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0) Timestamp: Wed, 27 Mar 2013 07:03:53 UTC Message: HTML Parsing Error: Unable to modify the […]

使用Fancybox的IE8中的jQuery问题

我最近收到了一个旧网站(我们正在谈论桌子,图像地图,你的名字)。 我被要求将Flash画廊的旧链接变成灯箱。 我只是在图库链接(右上角)上使用了javascript: openLightbox() )。 我知道,我知道,但这个网站似乎并不合适。 无论如何,我还包括一个JavaScript文件scripts.js,其中 包括fancybox的 jQuery和CSS文件。 使用AJAX获取一些图像文件名的JSON 在页面上创建一个隐藏的无序列表,其中包含指向JSON图像的链接 将fancybox方法附加到这些图像 然后,在openLightbox()我只需在第一个链接上调用click()函数。 我想,很好,很容易。 它在Firefox中就像一个魅力。 然后我的主要克星决定它不想打球。 这是IE7 / 8。 我已经将IE8开发者工具推出了一段时间,但一直未能弄清楚。 我得到的唯一错误是“v is null or not object”,它引用了Google CDN上的minified / packed jQuery代码。 显然这不是问题,所以有人知道这里有什么问题吗? 这是该页面的链接: http : //edgewaterterraces.com.au/ 也… script.js文件 非常感谢您的宝贵时间。 UPDATE 哇,似乎在这个页面上工作。 是什么赋予了?

IE 8:删除节点保留子节点

我试图使用javascript从dom树中删除一个节点,同时保持它的孩子。 我测试了下面显示的3种方法,它们在Firefox中运行良好但在IE 8中没有(参见下面的示例)。 function removeNodeKeepChildren(node){ // approach 1 jQuery(node.parentNode).children().map(function (index) { jQuery(this).replaceWith(jQuery(this).contents()); }); // approach 2 // doesn’t work with content() either jQuery(node.parentNode).html(jQuery(node).html()); // approach 3 var childfragment = document.createDocumentFragment(); for(var i=0; i<node.childNodes.length;i++){ childfragment.appendChild((node.childNodes[i]).cloneNode()); } node.parentNode.replaceChild(childfragment,node); } 示例输入节点: start text bold text end text 它应该导致什么: start text bold text end text IE 8的作用: start text […]

JQuery – $ .ajax() – 使用JSONP的跨源 – 仅在IE 8中获取’parsererror’(在IE 7中工作)

我有以下代码来执行跨域请求并获取JSONP数据(JSON由回调方法包装)。 我已经validation我正在使用包装我的JSON数据的回调方法正确获得响应。 它在IE7中完美地工作(回调cb被调用)但在IE8中没有。 $(document).ready(function () { var abc = $.ajax({ type: “GET”, url: “http://sd.domain.com/param1=a&param2=b&output=json&callback=cb”, dataType: “jsonp”, jsonp: false, cache: false, success: function (json) { }, error: function (e) { } }); abc.error(function (data, xhr, dat1) { }); abc.complete(function (xhr, status) { var data = xhr.responseText; }); }); function cb(dd) { alert(dd.people[0].nameFirst); } 我将statusText称为’Success’,StatusCode为xhr中的200。 此外,我无法为xhr找到任何称为responseText的属性。 那么如何在错误/完整function中获得响应? […]

用纯Javascript检查IE8是否

我曾经这样检查过: $.browser.msie && $.browser.version == 8 但似乎$.browser已从jQuery的后续版本中删除, 所以, 如何使用纯JavaScript进行检查? 我试过了: isIE8: navigator.appVersion.indexOf(“MSIE 8”) > 0 这似乎做到了,但它看起来并不那么好,实际上看起来有很多缺陷…… 任何更好的方法?

IE中的jQuery on()更改

使用jQuery 1.7.1,我试图在下拉列表中为change事件创建一个事件处理程序。 下拉列表会动态添加到DOM中。 似乎在大多数浏览器上都能很好地工作,但哦,那个怪异的IE8想要变得困难。 有解决方法吗? 这有用吗? 我在这里和其他地方做了很多阅读,在许多情况下输入似乎是相互矛盾的,我发现/尝试过的建议解决方案对我没用。 任何人都可以澄清这是否应该在IE8中用于.state-seletor创建的.state-seletor下拉列表? $( document ).on( ‘change’, ‘.state-selector’, function( e ) { e.preventDefault(); alert( ‘ON()’ ); }); 我会继续四处寻找,但如果有人能在我失去理智之前清除它,我会很感激。 谢谢。 UPDATE 在@ Wertisdk的请求下面,这是我的下拉片段: Select a state… Alaska Alabama … Wisconsin West Virginia Wyoming 更新2 对于@ mblase75而言,也许用于生成动态下拉列表的方法很重要。 本质上,我正在克隆现有的DOM节点并清空那里选择的值。 应该注意, .additionalink a也是动态生成的。 单击.addtionallink a ,正在克隆的模板包含一个新的.addtionallink a节点: $( document ).on( ‘click’, ‘.additionallink a’, function( […]

ie8 respond.js’undefined’为null或不是对象

我正在使用respond.js (该库为+1),并且我得到了对象的以下函数的错误: translate = function (styles, href, media) { // here I got ‘undefined’ error in IE 8 var qs = styles.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi), ql = qs && qs.length || 0; //try to get CSS path href = href.substring(0, href.lastIndexOf(“/”)); var repUrls = function (css) { return css.replace(/(url\()[‘”]?([^\/\)'”][^:\)'”]+)[‘”]?(\))/g, “$1” + href + “$2$3”); }, useMedia = !ql […]

jQuery:使用slideUp()/ slideDown()时IE8边距崩溃

我在这里上传了一个测试文件: http://dl.dropbox.com/u/2201804/IE8test.html 如果单击“Click me”div,您将看到使用slideDown()显示“Feedback”div。 单击另一个框中的“单击我”可以滑动当前显示的反馈并向下滑动相应的反馈。 在IE8中,在完成slideUp()/ slideDown()操作后,框之间的边距会折叠。 这是jQuery的动画或IE8中的显示错误的问题吗?

使用跨浏览器支持的jQuery更改类型

问题 以下脚本完全符合我的要求,在除IE8之外的所有测试的浏览器中,它删除按钮而不用任何替换它。 背景 我一直在研究一种方法,用jQuery替换提交类型输入和图像类型输入。 首先,我有以下内容适用于FF和webkit: marker = jQuery(”).insertBefore(‘input#SearchButton’); jQuery(‘input#SearchButton’).detach().attr(‘type’, ‘image’).attr(‘src’,theme_folder+’/style/images/search_button.png’).insertAfter(marker); marker.remove(); 但是,如果IE(它删除按钮,但不替换为图像),所有6个版本都会失败,所以我为IE浏览器开发了以下脚本: marker = jQuery(”).insertBefore(‘input#SearchButton’); new_search = jQuery(”) jQuery(new_search).insertAfter(‘input#SearchButton’); jQuery(‘input#SearchButton’).remove(); marker.remove(); 我正在使用HTML Conditionals来过滤到适当脚本的流量,所以整个事情看起来像这样: marker = jQuery(”).insertBefore(‘input#SearchButton’); jQuery(‘input#SearchButton’).detach().attr(‘type’, ‘image’).attr(‘src’,theme_folder+’/style/images/search_button.png’).insertAfter(marker); marker.remove();