我的网站使用jQuery 1.4.2。问题是.replaceWith()
在IE6中不起作用& jQuery 1.4.2中的IE7。 IE6 &在jQuery 1.4.2中支持IE7的替代方法吗?jQuery .replaceWith()备用
的小提琴是在这里:http://jsfiddle.net/8CEwf/1/
我知道,这似乎不是jQuery是连接到它,但如果你在HTML看,jQuery是有,因为的jsfiddle不提供1.4.2版
HTML:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<img src="/v/vspfiles/templates/cyberfront/images/buttons/btn_addtocart_small.gif">
<input type="image" src="/v/vspfiles/templates/cyberfront/images/buttons/btn_go_gray.gif">
<img src="/v/vspfiles/templates/cyberfront/images/Bullet_MoreInfo.gif">
脚本:
$(document).ready(function(){
$('img[src="/v/vspfiles/templates/cyberfront/images/buttons/btn_addtocart_small.gif"]').replaceWith('<br /><span id="blackbutton" class="mediumbutton" style="display:block;">Add to Cart</span>');
$('input[src="/v/vspfiles/templates/cyberfront/images/buttons/btn_go_gray.gif"]').replaceWith('<input type="submit" class="graybutton smallbutton" name="Go" alt="Go" value="Go" title="Go">');
$('img[src="/v/vspfiles/templates/cyberfront/images/Bullet_MoreInfo.gif"]').replaceWith('<span class="learnmore">Learn More</span>');
});
工程!谢谢。 – henryaaron 2011-12-20 02:33:48
无法修改核心页面...为什么我要经历整个障碍。 – henryaaron 2011-12-20 02:48:36
@ user1090389:啊,这很有道理。好吧,祝你好运! :) – Purag 2011-12-20 02:49:12