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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -