javascript - replace URL into HTML Jquery -
i have used static http:// url html(s) page, want replace empty string.
suppose here html content:
<div id="mso_contenttable"> <script type='text/javascript'> function redirecturl(redurl,curtab) { window.location.href='http://www.contoso.com/sales/sitepages/'+redurl; } function nav2lib(redurl) { navigatehttpfolder('http://www.contoso.com/sales/rfp%20bank/'+h3url, '_blank'); } function nav2proposal(redurl) { navigatehttpfolder('http://www.contoso.com/sales/proposals/'+h3url, '_blank'); } </script> ........ lots of html contents </div>
edit :
$('#mso_contenttable').html().replace(/http://www.contoso.com/g,'');
i want replace whole url "http://www.contoso.com/" empty string.
try this. think need escape 2 forward slashes
that's it.
$('#mso_contenttable').html().replace(/http:\/\/www.contoso.com/g,"");
Comments
Post a Comment