473,737 Members | 9,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Complete beginners question on adding to favorites...

2 New Member
Hi all I a complete beginner when it come to using HTML code so please help me out!

All I want to do is create a link in my document that will add my page to the browers' favorites list. What I have created is a Roll-Over image in Dreamweaver 8, which is placed is a layout table. I know that the code to put the page into the favorites folder is [HTML]onclick='window .external.AddFa vorite(location .href,document. title)[/HTML] however I don't know where to fit it into my code... Here's what I have...

[HTML] <td height="28" colspan="2" valign="top"><a href="#" onmouseout="MM_ swapImgRestore( )" onmouseover="MM _swapImage('Add toFav','','imag es/frontpageALT_04 .gif',1)"><img src="images/frontpage_04.gi f" name="AddtoFav" width="98" height="28" border="0" id="AddtoFav" /></a><a onmouseover="MM _swapImage('Add toFav','','imag es/frontpageALT_04 .gif',1)" onmouseout="MM_ swapImgRestore( )"></a></td>
<td colspan="5" valign="top"><i mg src="images/frontpage_05.gi f" width="413" height="28" /></td>[/HTML]

Thanks in advance for your help!

EDIT: Typo fixed
Sep 4 '07 #1
2 1527
173 Recognized Expert New Member
Hi Cob,

Welcome to TSDN...

To add the script functionality you would just put what you have within the anchor element that you want it to be linked to:

<a href="..." onclick="javasc ript"></a>
Secondly there is not standard way to add bookmarks, the script that you have is IE specific so if a user of any other browser clicked the link then script would not execute. A javascript function that works on IE and FireFox (sorry, haven't found the methods for other browsers at the moment) is:

Expand|Select|Wrap|Line Numbers
  1. function bookmark(){
  2.     var $title=document.title;
  3.     var $url=self.location.href;
  5.     if (window.sidebar){
  6.       window.sidebar.addPanel($title, $url,"");
  7.     } else if( document.all ){
  8.       window.external.AddFavorite( $url, $title);
  9.     } else {
  10.       alert("Sorry, your browser does not support this function. \n Please add the bookmark manually.");
  11.     }
  12.     return false;
  13. }
The onclick attribute of your anchor would then call this function:

<a href="#" onclick="return bookmark();"></a>
Sep 4 '07 #2
2 New Member
Thank you for this, it works perfectly and I certainly had no chance of getting there myself!
Sep 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: shank | last post by:
Is there any one "add to favorites" code that will work for IE, NS, AOL, and a host of others? At least some code that will give me an effective "add to favorites" for the highest percentage of users. The code in my searches have been disclaimed has working with this but not that. I'm not sure how old some of this code is either. thanks!
by: JP | last post by:
I have the need to be able to access the IE5+ favorites menu, read the title and URL for each shortcut so I can render the person's favorites list on a web page. The project I'm working on is written is C#, and is web based. I had hoped there was a URL property or something I could use in the System.IO class, but no such luck, and websites aren't very clear on the steps or even if its at all possible. Again, basically want to read...
by: Dennis Ruppert | last post by:
Greetings This is rather ambitious: I have a split database that contains many different reports. I have a form that the end user launches the reports from. They select the report criteria from several combo boxes, click a "Go" command button to launch the report. I then pass the report criteria to various report "templates" as an SQL string.
by: clintonG | last post by:
I've been hunting around. Does anybody have a URL to Microsoft'sdocumentation for Favorites? -- <%= Clinton Gallagher METROmilwaukee (sm) "A Regional Information Service" NET csgallagher AT metromilwaukee.com URL http://metromilwaukee.com/ URL http://clintongallagher.metromilwaukee.com/
by: Tom McL. | last post by:
I have a new computer which came with sp2 and framework 1.1. I have noticed that my favorites that contain links to visual basic.net subjects that were saved under the earlier version framework no longer work. Upon investigating I found that the help files in the following directory: C:\Documents and Settings\All Users\Application Data\Microsoft Help no longer supporting the early vb.net help files. I could copy the files from my old...
by: draken | last post by:
Basically, what I am looking to do is to sync up browsers favorites via a website without a download. I thought of javascript when first doing this, as I know, mozilla would allow me to pull them directly just with the js, but I do not want to have go beyond javascript and PHP. I have been going over making a mozilla extension as well as getting into some programming for a toolbar(I know some c/c++ and c#), but, if I can do something...
by: Killer42 | last post by:
I have actually asked a pretty similar question here in the past, without a great deal of success. But I've decided to try a different tack. So, what are the ways in which a network admin could remove the Favorites menu from Windows Explorer (presumably by use of a group policy), and how can I overcome it and put my favorites menu back where it belongs? Originally I was able to get it back by correcting...
by: hsriat | last post by:
I have a page working on Ajax. The problem is, after doing many changes using Ajax (like uploading, changing name, adding to favorites etc), the status bar starts behaving unexpectedly. Even when nothing is being transfered, it displays Transferring data from localhost... and that too continuously. The progress bar also shows that its working, and its all green (filled). It doesn't even occur on a particular action. Its just random. This is...
by: andrewq2 | last post by:
I have a post in fourms.micorsoft.com but no one is responding, and i had good luck in google groups befor so i decieded on posting my question here also. Im trying to add a favorites function to my web browser. the problem when i hit the add to favorites button it does nothing. but on form close it creates the favorites.xml file. so i know the problem is somewhere in the add to favorites function. hears my code:
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.