473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

mailto: link opening new browser window in Netscape

Hi all,
I've go a little mailto: link on a page that when clicked opens an
email form with the email address in the To field - all very simple.
Problem is that in Netscape, a new blank window is opened up as well,
along with the email form. Is there a way to stop this blank window
from opening? Below is the relevant code. My test browsers are IE 6
and NS 7.

function openwindow(location,width,height,name){

window.open(location,width,height,name);
}

<a href="javascript:void(0)"
onClick="openwindow('mailto:ab*@xyz.com','790','57 1','summary')"><img
src="..generic/weblink.gif" border="0" /></a>
Jul 20 '05 #1
4 11128
Ciar?n wrote:
I've go a little mailto: link on a page that when clicked opens an
email form with the email address in the To field - all very simple.
Problem is that in Netscape, a new blank window is opened up as well,
along with the email form. Is there a way to stop this blank window
from opening?
Yes, do not use your user-defined openwindow(...) method that calls
window.open(...). If supported, `mailto:' URIs already open a mail
compose window.
[...]
<a href="javascript:void(0)"
onClick="openwindow('mailto:ab*@xyz.com','790','57 1','summary')"><img
src="..generic/weblink.gif" border="0" /></a>
That hyperlink will not work without JavaScript and is therefore a Bad
Thing. Besides, `mailto:' URIs are not recommended since they fail if
there is no mail client installed or if one is installed but not
configured for the HTTP user agent (browser). Use a contact form and a
server-side form-mailer instead.

You should at least use

<a href="mailto:ab*@xyz.com"<img src="..generic/weblink.gif" border="0" /></a>


if you don't want to use a form-mailer.
PointedEars

Jul 20 '05 #2
Fox
You open a new window! That's what you get: a new window! Simple. Be glad
you GET a new window. It means Moz works. Dont make things to difficult and
just do:

<a href=mailto:su*****@ama.com>Send email</a>

The "mailto:" protocol will start a procedure to launch a mail program, but
you do TWO things: launch an email app + creating a new window.

I think that's it :)

http://www.amabuy.com
<a href="javascript:void(0)"
onClick="openwindow('mailto:ab*@xyz.com','790','57 1','summary')"><img
src="..generic/weblink.gif" border="0" /></a>

Jul 20 '05 #3
"Fox" <g-***@freegates.be> writes:
<a href=mailto:su*****@ama.com>Send email</a>


Just to nitpick: The href attribute value must be quoted, since it
contains a "@".
It is *much* safer to quote all attribute values than to worry about which
ones are allowed to be unquoted.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4
Fox
I like quotes too, but Outlook Express (yesyes) is a magical program which
behaves in its own special way: it removes the quotes sometimes.

Lasse Reichstein Nielsen <lr*@hotpop.com> schreef in berichtnieuws
ek**********@hotpop.com...
"Fox" <g-***@freegates.be> writes:
<a href=mailto:su*****@ama.com>Send email</a>
Just to nitpick: The href attribute value must be quoted, since it
contains a "@".
It is *much* safer to quote all attribute values than to worry about which
ones are allowed to be unquoted.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors:

<URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html> 'Faith without judgement merely degrades the spirit divine.'

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Edward King | last post by:
Hi! I am trying to achieve the following: I have a number of help pages (in the format help_nn.php where nn=helpid). I want to be able to open a particular help page by calling the function...
3
by: Clinton Goff | last post by:
I am attempting to write a javascript app that will open a second browser window, load a url, such as www.google.com (foreign url) and perform a <File-Save As> function on that window. I am able...
3
by: Farooq Karim | last post by:
Greetings; I am unable to solve this problem; I hope someone will come up to show his brilliance. From my web page I open another link in another browser window. That new window is composed...
10
by: Simon Wigzell | last post by:
Is there any way to create and open a window in javascript so that links in other websites won't "steal" it? I've written a web page with a form for people to enter headlines and URLs from...
3
by: Joop Kaashoek | last post by:
Just confirming, it looks like an Internet Explorer browser window can not be manipulated by JavaScript to hide its menu bar etc, is this correct?
13
by: zn | last post by:
How can I cause a link on a page to open up a new browser window when the link is clicked on? I've noticed javascript code sometimes when I try to right-click a link and open it in another window....
4
by: ryu | last post by:
is there a way to create a new browser window when the user clicks on a button? For example when a user clicks new product...A new product browser will appear and then the user will enter the new...
3
by: Larry Bud | last post by:
Wanting to use a technology I saw for one of our apps. We have several apps that a user logs in at on the same page. The app is determined by a drop down. User credentials are checked,...
3
by: sohan | last post by:
hi I have hyperlink column in a datagrid. The column contains the name of a text file. I am able to appendthe full path of the file. The file is on D drive on the server. But on clicking on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.