Bookmarking

liunx

Guest
On my site I have a form button that automatically sets the page it is on to the user's favorites.<br />
<br />
<INPUT TYPE="button" VALUE="Add to Favorites"<br />
onClick='window.external.AddFavorite(location.href, document.title);'><br />
</FORM><br />
<br />
However I was wondering if there is a way to keep the button on the page it is on but make my homepage the page that is linked to on the user's favorites when they click the button? Thanks ahead of time.<!--content-->i don't quite understand your q?, can you explain what you require better... jaeman<!--content-->Sure. Basically I want to have a button on my Pictures page that when pressed will set my Home Page URL in their favorites instead of the Pcitures page. Hope that explains it better.<!--content-->Sure you can. Simply change the location.href to 'http://www.yoururl.com' or 'http://www.yoururl.com/yourpage.html' with the single quotes. You will probably also want to change the document.title to 'what you want the Favorite Named' with the quotes. Otherwise if someone bookmarks from your pictures page it will bookmark your main page, but will call it "pictures" or whatever your pictures page is titled.<br />
<br />
Basically, just follow this format:<br />
'window.external.AddFavorite('destination url', 'name for page');<!--content-->I'm not quite sure what I did wrong but that doesn't want to seem to work...<br />
<br />
Here is a link to the page in question.<br />
HIGH School's Finest (<!-- m --><a class="postlink" href="http://www.geocities.com/Landstownsfinest/Pictures">http://www.geocities.com/Landstownsfinest/Pictures</a><!-- m -->)<!--content-->Sorry...here are the problems:<br />
<br />
1. You have the onclick using single quotes. I didn't notice this.<br />
2. you have a single quote (apostrophe) in the name. You have to put a \ before it, so that it doesn't read that as the ending quote. Use this:<br />
<br />
onClick="window.external.AddFavorite('http://www.geocities.com/landstownsfinest', 'HIGH School\\'s Finest');"<!--content-->The answer is always so simple. I really should have seen that one. Thanks alot for your help!<!--content-->
 
Back
Top