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>
@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.