Internet explorer Internet Explorer中更改元素属性的Jquery问题
我正在使用Jquery根据用户输入创建动态链接。我有一组元素在我的 ajax加载的div如下所示Internet explorer Internet Explorer中更改元素属性的Jquery问题,internet-explorer,jquery-selectors,Internet Explorer,Jquery Selectors,我正在使用Jquery根据用户输入创建动态链接。我有一组元素在我的 ajax加载的div如下所示 <div class="mxcell"> <input type="text" size="40" class="input_name" value=""> <a href="#" target="_blank" class="dyn_link"> <img src="http://127.0.0.1/images/arrow_right.gif">
<div class="mxcell">
<input type="text" size="40" class="input_name" value="">
<a href="#" target="_blank" class="dyn_link">
<img src="http://127.0.0.1/images/arrow_right.gif">
</a>
</div>
这在Chrome/Firefox中运行良好,但在Internet Explorer中不起作用
有什么想法吗
IE调试器指向Jquery第69行字符15。我不知道要进一步调查
更新:
我通过使用focusOut()而不是change()解决了上述问题
但我仍然不确定是否有更好的解决方案
我想keyup
而不是focusOut
,我稍微清理了一下你的href转换器:
$("#right").delegate(".input_name", "keyup", function() {
var $this = $(this);
var dyn_link = $this.val();
$this.next("a").attr("href","http://www.example.com/" + dyn_link + ".html");
});
在更改inputfeld中的值时,会创建一个动态链接,如href=''。在IE中,这仍然是href=“#”
$("#right").delegate(".input_name", "keyup", function() {
var $this = $(this);
var dyn_link = $this.val();
$this.next("a").attr("href","http://www.example.com/" + dyn_link + ".html");
});