我使用以下代码从data
字符串中删除html标记。
$($(data).text()).text();
导致控制台出现以下错误。
jquery-1.11.1.min.js:2 Uncaught Error: Syntax error, unrecognized expression: API to manage person entities in the customer care system.Operation Detail - Create PersonCreates a new personURI: /customer/v1/PersonsHTTP Method: POST
at Function.fb.error (jquery-1.11.1.min.js:2)
at fb.tokenize (jquery-1.11.1.min.js:2)
at fb.select (jquery-1.11.1.min.js:2)
at Function.fb [as find] (jquery-1.11.1.min.js:2)
at m.fn.init.find (jquery-1.11.1.min.js:2)
at new m.fn.init (jquery-1.11.1.min.js:2)
at m (jquery-1.11.1.min.js:2)
at eval (eval at render (pg-top-assets-table.js:17), <anonymous>:1:1)
at render (pg-top-assets-table.js:17)
at jquery.dataTables.min.js:18
字符串如下,
API to manage person entities in the customer care system.<p style="text-decoration: underline;"><h4><strong>Operation Detail - Create Person</strong></h4></p><p>Creates a new person</p><p><strong>URI: </strong>/customer/v1/Persons</p><p>HTTP Method: POST</p>
答案 0 :(得分:0)
$($(data).text()).text();
这是错误的,就像这样:
$("#"+$(data).text()).text();