Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery解码html实体&;微型的;_Jquery_Html_Entity_Decode - Fatal编程技术网

jquery解码html实体&;微型的;

jquery解码html实体&;微型的;,jquery,html,entity,decode,Jquery,Html,Entity,Decode,我发现使用jquery和html实体时,html实体没有自动解码的问题,我想 我研究了很多并尝试了一些jQueryHTML实体解码选项,但我一辈子都无法解决这个问题。任何意见都将不胜感激 使用jquery库3.1.1 btw 这个脚本最初可以分离并重新组织成新元素。它改变了这一点: <ul class="productList"> <li class="product"> <p class="summary_description">

我发现使用jquery和html实体时,html实体没有自动解码的问题,我想

我研究了很多并尝试了一些jQueryHTML实体解码选项,但我一辈子都无法解决这个问题。任何意见都将不胜感激

使用jquery库3.1.1 btw

这个脚本最初可以分离并重新组织成新元素。它改变了这一点:

   <ul class="productList">
    <li class="product">
    <p class="summary_description">
   [[25µg, ABP-NAB-BFGFAB]]
   </p>
   </li>
   </ul>
还是尝试使用unicode

   if( $(".productList li").length > 0 ) {
        var txt = $(".prodoweight").html();
        txt = txt.replace("\&micro\;", /\[\[([\w\s,\-\u00B5.&;])+\]\]/g);
        $(".prodoweight").html(txt);
    }
或者在最初的脚本中有更好的方法来实现这一点???非常感谢。

更改了线路

var content = $(this).val(".summary_description").html();
为此:

var content = $(this).val(".summary_description").text();
它就像一个符咒

   if( $(".productList li").length > 0 ) {
        var txt = $(".prodoweight").html();
        txt = txt.replace("\&micro\;", /\[\[([\w\s,\-\u00B5.&;])+\]\]/g);
        $(".prodoweight").html(txt);
    }
var content = $(this).val(".summary_description").html();
var content = $(this).val(".summary_description").text();