...

View Full Version : code not seen on page



undyingfires
10-28-2002, 09:53 PM
I have a small javascript code on my page that allows someone to save the page to be bookmarked (:) which I got from here) and it looks okay in explorer. I have a css file attached as well and in that file, the links are made to look a certain way.

But in netscape, I can not see anything from this code.
"Add to Favourites" isn't even seen, nothing.

Am I doing anything wrong or silly question, is this a problem with netscape and can I fix it?


thank you :)

Roy Sinclair
10-28-2002, 11:39 PM
Show the code. It's probably a check in the code itself that makes the decision whether to display the link since the way you add a favorite in IE isn't the same as adding a bookmark in Netscape.

brothercake
10-29-2002, 11:17 AM
to external.addFavourite property is proprietary to IE. Unfortunately there is no Netscape equivalent.

Zvona
10-29-2002, 11:31 AM
In addition for IE :

I created a shortcut creator, which allows an user to save hir favorite site as an shortcut that can be placed eg. in Desktop. Thought, you'd be interested :


<!-- Example Written by Zvona -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1;">
<script type="text/javascript">
function zBookmark()
{
sPageName = (arguments[0])?arguments[0]:"default.url";
document.writeln("[DEFAULT]");
document.writeln("BASEURL=http://www.google.com/");
document.writeln("[InternetShortcut]");
document.writeln("URL=http://www.google.com/");
document.writeln("Modified=F05B73A1A279C2013D");
document.writeln("IconFile=http://www.google.com/favicon.ico");
document.writeln("IconIndex=1");
document.execCommand("SaveAs",false,sPageName);
history.back();
}
</script>
</head>
<body>
<form name="saveMe">
<input type="button" value="Create a bookmark" onclick="zBookmark('Google.url');" />
</form>
</body>
</html>

undyingfires
10-29-2002, 02:22 PM
Well, thanks everyone. :)

I'll have to get the code tomorrow since I am not at home. But if it helps I do believe I got the code at the javascriptkit url.

And that desktop code Zvona, I actually like that idea. Thanks for posting it here.

:)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
<SCRIPT LANGUAGE=JavaScript>var lookup=navigator.appVersion
aol = (lookup.indexOf("AOL") > 0 );
if (aol) // Only true for AOL
{
document.write("Add to favourites!");
}
else
{
ie4 = ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4 ));
if (ie4) // Only true for MSIE
{
var url="your_URL";
var title="your page title";
document.write('<A HREF="javascript:window.ext');
document.write('ernal.AddFavorite(url,title);" ');
document.write('onMouseOver=" window.status=');
document.write("'Add to favourites! '; return true ");
document.write('"onMouseOut=" window.status=');
document.write("' '; return true ");
document.write('"><font size="-3">Add to favourites!</font></a>');
}
}
ns4 = (navigator.appName == "Netscape");
if (ns4) // Only true for Netscape
{
document.write("Press CTRL+D to Add to favourites!");
}
</SCRIPT>
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

I found it :D
I didn't do much but change what I was allowed to do. So, this is pretty much the original code.

But I now think half of not seeing that code has to do with my background being black?

Roy Sinclair
10-29-2002, 07:27 PM
I would guess that since the code you showed does display a message to use CTRL-D to add a bookmark in Netscape that your background color may be the problem. Make sure your text color is also set at the same point where you set the background color.

undyingfires
10-29-2002, 07:34 PM
Well, nonetheless thanks to all :)
I'll have to change that colour or my text - whichever come first (:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum