|
Answer» Hello
i am developing a school website and i want to add a BOOKMARK button and also a search within the website button...i use frontpage 2003 and i have tried several code but they didnt work..
this is one of the codes i tried
<a href=index.html#" ondragstart="return false" onclick="window.external.AddFavorite(location.href, document.title);return false" onmouseover="window.status='Add to Favorites';return true">BookMark [/url]Most of that code is not needed.
Add this to the head of your page: Code: [Select]<script type="text/javascript" language="javascript"> function addBookmark(title, link) { window.external.AddFavorite(link, title); } </script>
Add this where ever you want the link: Code: [Select]<a href="#" onclick="addBookmark('Name of Site', 'http://www.mysite.com/');">Add Bookmark</a> pretty thanks the code works fine now but i need to KNOW how to add to a button....and PLZ, dont discard my Search button question tooOops, sorry I missed your second question.
Is it that you want to have a button to add to bookmarks?
In the , add the same code as above, and in the , add:
Code: [Select]<input type="button" onclick="addBookmark('Name of Site', 'http://www.mysite.com/');" /> For the search... Is it a search ENGINE you want on your site? If so, I'd recommend Google Custom Search.the bookmark button work fine but can i add the code to a shape that i already created? In the first example:
Add this to the head of your page: Code: [Select]<script type="text/javascript" language="javascript"> function addBookmark(title, link) { window.external.AddFavorite(link, title); } </script>
Add this where ever you want the link: Code: [Select]<IMG src="path/to/shape.gif" onclick="addBookmark('Name of Site', 'http://www.mysite.com/');" />
thanks a lot for the help both of them works fine now thanks again
No PROBLEM. Glad you got it sorted.
|