Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/447.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
Javascript 在jQuery中使用remove/hide而不是split和join_Javascript_Jquery_Asp.net - Fatal编程技术网

Javascript 在jQuery中使用remove/hide而不是split和join

Javascript 在jQuery中使用remove/hide而不是split和join,javascript,jquery,asp.net,Javascript,Jquery,Asp.net,我想删除网页(.aspx页)上显示的所有符号 我正在使用下面的jQuery $(':contains("£")').each(function(){ $(this).html($(this).html().split("£").join("")); }); Split and Join可以工作,但会对网页(.aspx)样式造成一些问题。我不确定是什么原因导致了这个问题 所以我想知道,我是否可以使用隐藏或删除来删除网页(.aspx)上的符号,而不是拆分和加入 我所要做的就是从网页(.as

我想删除网页(.aspx页)上显示的所有符号

我正在使用下面的jQuery

$(':contains("£")').each(function(){
    $(this).html($(this).html().split("£").join(""));
});
Split and Join可以工作,但会对网页(.aspx)样式造成一些问题。我不确定是什么原因导致了这个问题

所以我想知道,我是否可以使用隐藏或删除来删除网页(.aspx)上的符号,而不是拆分和加入

我所要做的就是从网页(.aspx)中隐藏或删除£symbol


请告知。

您可以使用
RegExp
replace
方法,如下所示:

$('table').html($('table').html().replace(new RegExp('£', 'g'), ''));

“修复”服务器的输出它是一个.net框架,我没有访问后端的权限。我只能添加JQuery来进行前端更改。所以,这就是限制。这不起作用。请检查我是否正在使用此$(':contains(£”).each(function(){$(this).html($(this.html().replace(new RegExp('£,',''),'');});但这在某种程度上影响了CSS样式。也许我需要进一步检查。