Forum Moderators: open

Message Too Old, No Replies

Using a Bookmark Java Script

         

webgaya

5:50 pm on Oct 9, 2005 (gmt 0)

10+ Year Member



I have a bookmark java script as follows.

var urlAddress = "http://www.domainname.com/index.html";
var pageName = "web site name";

function addToFavorites()
{
if (window.external)
{
window.external.AddFavorite(urlAddress,pageName)
}
else
{
alert("Sorry! Your browser doesn't support this function.\nChecck the menu to add manually");
}
}

And I use the link as follows.

<a href="javascript:addToFavorites()">Bookmark This Site!</a>

This link doesn’t work unless the java script (bookmark.js) is in root directory. How can I make this work when the bookmark.js is in a sub directory.

Bernard Marx

7:36 pm on Oct 9, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This isn't dependent on the function itself. Check how you are linking to your script from the page.

<script src="[path to script folder]/bookmark.js"></script>

webgaya

5:06 pm on Oct 10, 2005 (gmt 0)

10+ Year Member



Thank you very much "Bernard Marx"