[Javascript] Adding scriptlet to favourites menu via javascript (IE6+)

david_chance at yahoo.com.au david_chance at yahoo.com.au
Tue May 27 10:56:27 CDT 2008


Since "Javascript" is a defined word, perhaps you need to double
up the ""?

Just a thought.


--- John Warner <john at jwarner.com> wrote:

> I've never tried what you are doing, but I suspect you are
> denied for
> security reasons. To protect a user from clicking on a script
> that might do
> harm.
> 
> John Warner
> 
> 
> 
> 
> > -----Original Message-----
> > From: javascript-bounces at lists.evolt.org 
> > [mailto:javascript-bounces at lists.evolt.org] On Behalf Of JS
> Student
> > Sent: Tuesday, May 27, 2008 7:09 AM
> > To: javascript at lists.evolt.org
> > Subject: [Javascript] Adding scriptlet to favourites menu
> via 
> > javascript (IE6+)
> > 
> > 
> > Hi,
> > 
> > I am sorry if this has been asked already.
> > 
> > I have a scriptlet on my website that I want to add to the 
> > user's favorites menu (Internet Explorer 6+). I am using:
> > 
> > window.external.AddFavorite(url,title);
> > 
> > This works fine when the url is "http:" protocol based but
> it 
> > wont let me add a "javascript:" url. The error I get is 
> > permission denied.
> > 
> > This is my code:
> > 
> > /*BEGIN CODE*/
> > // JavaScript OnClick handler:
> > function addScriptletToFavs() {
> >    var url = "JavaScript:myfucn();void();";
> >    var title = "My Scriptlet";
> > 
> >    window.external.AddFavorite(url,title);
> > }
> > 
> > // HTML code for button:
> > <input type="button" value="Add to Favourites" 
> > onclick="JavaScript:addScriptletToFavs();" />
> > 
> > /*END CODE*/
> > 
> > Can anybody please help me in this regard?
> > 
> > Thanks in advance.
> > 
> > Aaron.
> > _______________________________________________
> > Javascript mailing list
> > Javascript at lists.evolt.org 
> > http://lists.evolt.org/mailman/listinfo/javascript
> > 
> 
> 
> _______________________________________________
> Javascript mailing list
> Javascript at lists.evolt.org
> http://lists.evolt.org/mailman/listinfo/javascript
> 



      Get the name you always wanted with the new y7mail email address.
www.yahoo7.com.au/mail



More information about the Javascript mailing list