Kim Ryan
asked on
href link to open a browser from an outlook HTML email using javascript
I need to include a web site link in an email I am sending to users of MS Outlook 2000.
The email is sent in HTML format and it all displays correctly. Here is the code I use:
<a href="javascript:window.op en('http://www.mysite.com','my_title','toolbar=no,
location=no,directories=no ,status=no ,menubar=n o,scrollba rs=no,resi zable=no,
width=500,height=400')">My Link</a>
This works fine and opens the browser with no scrollbars, buttons etc as I have specified. The problem is that a second full sized browser appears behind the first. In the browsers and in the brwoser itself,it just says: [object]
I have tried links in the follwing formats but they don't start a browser at all
<a href="window.open(...
<a href onclick="window.open(...
Is there a way to suppress this second browser from appearing?
The email is sent in HTML format and it all displays correctly. Here is the code I use:
<a href="javascript:window.op
location=no,directories=no
width=500,height=400')">My
This works fine and opens the browser with no scrollbars, buttons etc as I have specified. The problem is that a second full sized browser appears behind the first. In the browsers and in the brwoser itself,it just says: [object]
I have tried links in the follwing formats but they don't start a browser at all
<a href="window.open(...
<a href onclick="window.open(...
Is there a way to suppress this second browser from appearing?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also consider using the onclick handler ... by returning false you can possibly eliminate that pesky second browser:
<a href="http://www.mysite.com" target="my_title"
onclick="window.open( this.href, this.target, 'toolbar=no,location=no,di rectories= no,status= no,menubar =no,scroll bars=no,re sizable=no ,
width=500,height=400');ret urn false;">My Link</a>
<a href="http://www.mysite.com" target="my_title"
onclick="window.open( this.href, this.target, 'toolbar=no,location=no,di
width=500,height=400');ret
Mmmm.... Interesting idea, how about ignoring the original function of the element, and simply ignore href:
<a onclick="window.open( 'http://www.mysite.com', this.target, 'toolbar=no,location=no,di rectories= no,status= no,menubar =no,scroll bars=no,re sizable=no ,
width=500,height=400')">My Link</a>
<a onclick="window.open( 'http://www.mysite.com', this.target, 'toolbar=no,location=no,di
width=500,height=400')">My
ASKER
thanks _aaron_ and knightEknight. I tired both suggestions, but they both launch full size browsers with scrollbars and buttons. Also, from outlook preview pane, the email displays a script icon, which may cuase some people to think they have a virus attached to the email.
I can live with the second browser window being manully closed, if there is no other work around.
I can live with the second browser window being manully closed, if there is no other work around.
If the above methods dont work, I cant see any other way around...
ASKER
the opener.close() works OK, but the alert window can get obscured so may confuse the user. thanks for your help.
np ;-) Happy to help!
PS: Maybe try opener.focus();opener.clos e(), it *should* give the parent focus before closing (thus alert will appear in front of screen )
PS: Maybe try opener.focus();opener.clos
<a href="http://www.mysite.com','my_title','toolbar=no,
location=no,directories=no
width=500,height=400'">My Link</a>