与jQuery动态相关的选择,在IE中不起作用 [英] Dynamic Related Selects with jQuery, not work in IE

查看:50
本文介绍了与jQuery动态相关的选择,在IE中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在制作一个表格,我已经制作好了,它可以工作...但是在IE中不行.

So I am making a form, well I've made it and it works... but not in IE.

我不知道为什么.在除IE之外的所有其他浏览器中,初始的"make"选择都会影响第二个模型的内容.尽管如此,它在IE中什么也没做.

I have no idea why though. In every other browser but IE, the initial "make" select affects the content of the 2nd one: model. Nevertheless it does nothing in IE.

这是指向页面的链接,您可以在以下页面上对其进行测试:

Here's the link to a page you can test it out on: [edit - no link]

这是我用来更新第二个盒子的方法:

This is the method I used to update the 2nd box:

  1. 在第一次选择的更改"事件(jQuery)上,javascript会获取所选的值并将其应用于变量.

  1. On the "change" event (jQuery) of the first select, javascript grabs the value selected and applies it to a variable.

案例选择完成,将新变量与通过第二个选择的.innerHTML属性插入的一定数量的潜在选项进行匹配.

A case select is done, matching the new variable to a set amount of potential options to be inserted via the .innerHTML property of the 2nd select.

JavaScript中也已安装了默认值-Please Select Model-",但IE中也没有显示此默认值. (这使我相信应该有一个可以解决整个问题的快速解决方案)

A default value of "-- Please Select Model --" has been installed too within the JavaScript, yet not even this shows up in IE either. (this leads me to believe there should be a quick fix that solves the entire issue)

通过PHP,快速查询表单是插入的",但是如果您在页面上查看源代码",仍然可以看到所有代码.

Via PHP, the quick inquire form is "inserted", but you can still see all the code if you "View Source" on the page.

感谢您的帮助!

推荐答案

在MAKE的select下,我没有在IE中看到option标记.我猜您没有默认标签,而FF会自动添加它们,但IE不会.您是否在代码中明确标出了它们?好的,我看到您的default.我发现此 http://domscripting.com/blog/display/99 可能有用为您的解决方案.

I'm not seeing option tags in IE under the select for the MAKE. I am guessing you do not have default tags, and FF is adding them automatically but IE is not. Do you explicitly call them out in your code? Okay, I see your default. I found this http://domscripting.com/blog/display/99 that may be useful for your solution.

仅在IE中设置innerHTML的要旨是越野车.该链接提供了解决方案.我建议制作option元素,设置其innerHTML,然后将其放置在select元素中(这似乎是他们所说的使用过程).

The gist of it is setting innerHTML only in IE is buggy. The link gives a solution. I suggest making the option element, setting its innerHTML, then placing it in the select element (that seems to be the process they say to use).

还在这里找到了类似的解决方案: IE中的一个选择框

Also found similar solution here: Setting innerHtml of a selection box in IE

这篇关于与jQuery动态相关的选择,在IE中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆