You*_*uss 0 javascript jquery replace
我想删除一些text
用这段代码说的文字:
$(".jq-text li a").html(function(i, h){
return h.replace(/text/, "");
});
Run Code Online (Sandbox Code Playgroud)
正如预期的那样,它运作良好.问题是我想删除文本http://
,所以我试过:
$(".jq-text li a").html(function(i, h){
return h.replace(/http:///, "");
});
Run Code Online (Sandbox Code Playgroud)
这在Dreamweaver中给我一个错误......我该怎么写呢?
你需要逃避/
使用\/
尝试,
$(".jq-text li a").html(function(i, h){
return h.replace(/http:\/\//, "");
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
138 次 |
最近记录: |