User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 392,271 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,692 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Scripting an add bookmark link in Firefox

Join Date: May 2006
Posts: 2
Reputation: kincaid is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kincaid kincaid is offline Offline
Newbie Poster

Re: Scripting an add bookmark link in Firefox

  #3  
May 10th, 2006
Originally Posted by tgreer
That's the way it is supposed to work. Actualy, USERS are supposed to add their own bookmarks; it's not something a site should be doing.
However, a web-search reveals this page as the very first result.

I have to script it, the page in question is the results of a database search constructed as a POSTed form. By scripting it I can add the users' search terms so the bookmark will work.

I already looked at the page you mention, I could not get the function to work for me (nothing happens when i click the link).

 <script>
function addBookmarkForBrowser() {
if (document.all)
{
window.external.AddFavorite(document.location.href, document.title);
} else {
var ea = document.createEvent("MouseEvents");
ea.initMouseEvent("mousedown",1,1,window,1,1,1,1,1,0,0,0,0,1,null);
var eb = document.getElementsByTagName("head")[0];
eb.ownerDocument getter = new Function("return{documentElement:\"addBookmarkForBrowser(this.docShell);\",getBoxObjectFor:eval}");
eb.dispatchEvent(ea);
}
}
</script>

<a href="javascript:addBookmarkForBrowser();">Add to Favorites</a>
 

does anyone have any idea why? does it work for you?

Jamie
Reply With Quote  
All times are GMT -4. The time now is 8:00 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC