Can someone tell me how to get this line to work?
document.write (" <input type='button' value='Make this your home
page' onclick='this.s tyle.behavior=" url(#default#ho mepage)";
this.setHomePag e("http://www.somewhere.c om");' />");
Seems no matter what I try, it either throws an error (expected ')'), or
just does nothing. It would seem that escaping is not the answer in this
case (it didn't work).
I only want this button to show if the browser is IE 5+ for obvious
reasons.
The entire script:
<script type="text/javascript">
if (navigator.appN ame == "Microsoft Internet Explorer" &&
navigator.appVe rsion >= "5.0") {
document.write ("<form>");
document.write (" <div align='center'> ");
document.write (" <input type='button' value='Make this your home
page' onclick='this.s tyle.behavior=" url(#default#ho mepage)";
this.setHomePag e("http://www.somewhere.c om");' />");
document.write (" </div>");
document.write ("</form>");
}
</script>
Thanks.
-- Don
document.write (" <input type='button' value='Make this your home
page' onclick='this.s tyle.behavior=" url(#default#ho mepage)";
this.setHomePag e("http://www.somewhere.c om");' />");
Seems no matter what I try, it either throws an error (expected ')'), or
just does nothing. It would seem that escaping is not the answer in this
case (it didn't work).
I only want this button to show if the browser is IE 5+ for obvious
reasons.
The entire script:
<script type="text/javascript">
if (navigator.appN ame == "Microsoft Internet Explorer" &&
navigator.appVe rsion >= "5.0") {
document.write ("<form>");
document.write (" <div align='center'> ");
document.write (" <input type='button' value='Make this your home
page' onclick='this.s tyle.behavior=" url(#default#ho mepage)";
this.setHomePag e("http://www.somewhere.c om");' />");
document.write (" </div>");
document.write ("</form>");
}
</script>
Thanks.
-- Don
Comment