Javascript Regex replace在IE10中不起作用
Javascript Regex replace not working in IE10
以下JS在FF中运行良好,但不会取代IE10中的任何东西:
var pattern = new RegExp('<span id='"(.+?)'" class='"questiontext'"><p(.*?)>(.+?)<'/p><'/span>', 'gim');
$('.questiontext_div').html(function(index, html) { return html.replace(pattern,'<span id="$1" class="questiontext"><legend>$3</legend></span>'); });
我正试图用一个传说来代替p。
<div class="questiontext_div">
<span id="C00B7205241531FD2BEF31301000101F0DESC" class="questiontext">
<P style="font-weight: bold; color: #005881;">Text will go here!</P>
</span>
</div>
这可能更简单:
$('span.questiontext p').replaceWith('<legend...etc>');
并在所有浏览器上工作
相关文章:
- 链接上的IE10 jquery句柄单击事件不起作用
- IE9+IE10 AJAX调用不起作用
- JSON.stringify在IE10中不起作用
- IE10在打开窗口并再次打开另一个窗口时不起作用
- Dropzone.js Drag&Drop 在 IE10 中不起作用
- 异物在 IE10 中不起作用
- $.getJSON 在 IE10 中不起作用
- IE10 函数负载设置间隔不起作用
- 我的 js 代码在 IE10 上不起作用
- 脚本标签的动态创建和 src 加载在 ie10 中不起作用
- Jquery 1.10.2 在 IE10 中不起作用 - JSON
- 幻灯片在IE10中不起作用
- Javascript/Prototype Effect Parallel在IE10中不起作用
- 使用javascript进行日期格式化在IE10上不起作用
- Html图像在IE10中不起作用
- Javascript Regex replace在IE10中不起作用
- window.open在IE10中不起作用
- Javascript dispatchEvent click在IE9和IE10中不起作用
- AngularJS路由有时在IE10上不起作用
- 样式显示:没有在IE8、IE9、IE10兼容性视图中不起作用