0
   

Find and replace html using javascript

 
 
Reply Sat 5 May, 2012 06:06 am
I want to change my html depending on what browser the user is using.
I know the regular expression works as I've tested it endlessly.
Can anyone help?
Here is the code

<script language="JavaScript"
type="text/JavaScript">
if(navigator.appName == "Microsoft Internet Explorer")
{
function replaceit(s) {
s.replace(/.*data=\"(.+?).svg".*/g, " <!-- end .content --> <div class=\"content\" style=\"text-align: center;height: 1000px;\"><img src=\"$1.html\" width=\"1104\" height=\"111\" alt=\"Gastroenterology Book\" /></div>"); }

}
</script></head>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 3,205 • Replies: 1
No top replies

 
kraj8995
 
  0  
Reply Thu 5 Jul, 2012 12:35 am
@sebastiz,
The replace() method searches a string for a specified value, or a regular expression, and returns a new string where the specified values are replaced.
0 Replies
 
 

Related Topics

 
  1. Forums
  2. » Find and replace html using javascript
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/16/2024 at 04:46:40