View Full Version : bookmark script

brian northmore
11-22-2007, 07:38 PM
1) Script Title:
2) Script URL (on DD):
3) Describe problem:

I am enclosing the script I copied to see if you can help. When I try to run it I get an error on page as described:



<script type="text/javascript">
* Bookmark site script- Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

/* Modified to support Opera (v9 tested) */
function bookmarksite(title,url){
if (window.sidebar) // firefox
window.sidebar.addPanel(title, url, "");
else if(window.opera && window.print){ // opera
var elem = document.createElement('a');
else if(document.all)// ie
window.external.AddFavorite(url, title);

<a href="javascript:bookmarksite('Yahoo', 'http://www.yahoo.com');">Bookmark Yahoo</a>



I set up a simple html file to test the bookmark before using it on my site, but I am getting the following error:

Line: 24
Char: 2
Error: Object doesn't support this propertty or method
Code: 0
URL file: //etc

I am using windows Vista basic edition



11-22-2007, 07:48 PM
Some of the IE extended functions are blocked in Vista, but it might be just that this works live and not locally. Did you test your page on the server, or just on your hard drive? Does the demo page on Dynamic Drive for this script work for you?

brian northmore
11-23-2007, 07:51 PM
i only tried it locally but thanks i'll give it a go.

yes the demo does work so i think you have solved it for me - thanks