Why this script is not working in FF?

Loganathan Natarajan
Loganathan Natarajan used Ask the Experts™
on
The attached script is working in IE but not in FF. Is there a solution to work in FF?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="800" border="0" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr> 
    <td width="800" height="51" valign="top"> <div align="center"><span id=hp style="behavior:url(#default#homepage)"></span> 
        <script class="p">
//<!--
if (!hp.isHomePage('http://www.boscoits.com/')) {document.write("<p><a href=\"http://www.boscoits.com\" onClick=\"style.behavior='url(#default#homepage)';setHomePage('http://www.boscoits.com/');\">Make This Site Your Homepage!<br>Click Here</a>");}
//-->

</script>
      </div></td>
    </tr>
  <tr>
    <td height="549">&nbsp;</td>
  </tr>
</table>
</body>
</html>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010
Commented:
Firefox doesnt allow this kind of actions.
Commented:
Found a sample code to set homepage in IE/FF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<script language="javascript">
	function gHomePage(objSrc)
	{
	    var homepage = "http://example.com";
	    if (objSrc.style.behavior)
	    {
	        objSrc.setHomePage(homepage);
	    }
	    else if (netscape
	              && netscape.security
	              && netscape.security.PrivilegeManager
	              && navigator.preference)
	    {
	        netscape.security.PrivilegeManager.enablePrivilege("UniversalPreferencesWrite");
	        navigator.preference("browser.startup.homepage", homepage);
	    }
	}
	</script>

<body>
<a style="behavior:url(#default#homepage)"
   href="#"
   onclick="gHomePage(this); return false">Test
</a>

</body>
</html>

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial