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"
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>"); }

  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 2,947 • Replies: 1
No top replies

Reply Thu 5 Jul, 2012 12:35 am
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

How does one uninstall a program? - Question by Woollcott
Adding a JavaScript 'Copy to Clipboard' - Discussion by BobbyDouglas
JavaScript: OnSelect question - Discussion by neocode
Javascript - Control C textarea script - Discussion by Craven de Kere
2018123 - Question by ibk1995
javascript loops for - Question by vartul agnihotri
  1. Forums
  2. » Find and replace html using javascript
Copyright © 2021 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/16/2021 at 06:47:06