DIYGUY
03-19-2009, 05:44 PM
As a parallel thread to my earlier one about bookmarking URLs, this post is the source of the trouble that I am trying to solve with my previous post. If I cannot find any help with that post, perhaps someone can help me solve this issue?
I inherited the following script from an app and it works just fine in FireFox, but not in IE. If you have any insights to share on why this is the case and what I could do to make it work in both realms please share them.
Here is the Jscript that works fine in FireFox:
function addbookmark(){
if (document.all) {
window.external.AddFavorite(window.location.href,document.title);
} else {
alert("Use CTRL-D to add a bookmark in your Browswer.");
}}
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
This is how it is called from the XHTML:
<a href="javascript:addbookmark()"><img src="images/bookmark.gif"" /></a>
This is in the head section of the pages that use the script:
<script language="JavaScript" type="text/javascript" src="Jscript/bookmark.js"></script>
The only thing this little script does is create a popup window with the alert text in it. The message that IE gives the viewer is "Error on page." The popup blocker is turned off.
All comments and thoughts are welcome!
I inherited the following script from an app and it works just fine in FireFox, but not in IE. If you have any insights to share on why this is the case and what I could do to make it work in both realms please share them.
Here is the Jscript that works fine in FireFox:
function addbookmark(){
if (document.all) {
window.external.AddFavorite(window.location.href,document.title);
} else {
alert("Use CTRL-D to add a bookmark in your Browswer.");
}}
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
This is how it is called from the XHTML:
<a href="javascript:addbookmark()"><img src="images/bookmark.gif"" /></a>
This is in the head section of the pages that use the script:
<script language="JavaScript" type="text/javascript" src="Jscript/bookmark.js"></script>
The only thing this little script does is create a popup window with the alert text in it. The message that IE gives the viewer is "Error on page." The popup blocker is turned off.
All comments and thoughts are welcome!