473,587 Members | 2,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(loca tion,width,heig ht,name){

window.open(loc ation,width,hei ght,name);
}

<a href="javascrip t:void(0)"
onClick="openwi ndow('mailto:ab *@xyz.com','790 ','571','summar y')"><img
src="..generic/weblink.gif" border="0" /></a>
Jul 20 '05 #1
4 11142
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="javascrip t:void(0)"
onClick="openwi ndow('mailto:ab *@xyz.com','790 ','571','summar y')"><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>Se nd 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="javascrip t:void(0)"
onClick="openwi ndow('mailto:ab *@xyz.com','790 ','571','summar y')"><img
src="..generic/weblink.gif" border="0" /></a>

Jul 20 '05 #3
"Fox" <g-***@freegates.b e> writes:
<a href=mailto:su* ****@ama.com>Se nd 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/rasterTriangleD OM.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**********@ho tpop.com...
"Fox" <g-***@freegates.b e> writes:
<a href=mailto:su* ****@ama.com>Se nd 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/rasterTriangleD OM.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
2657
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 gethelp(nn) where nn is the helpid. The function is contained in a header file called funcs.inc that each page
3
3501
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 to do this with opening a second window that loads a local file, but I get an Access Denied error when I attempt this with a different website. Is...
3
2716
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 of two frames. I have a <a href="....."> link on the second frame of that window. What I want is that when user clicks on the link in the new...
10
2384
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 newspapers. They will want my window to stay there as they surf through various online newspapers. We don't want their popup links to take over my form...
3
1447
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
5761
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. Is there a way to use straight HTML to cause a link to open a new browser window? Thanks.
4
1048
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 product information and click save. And when the solution you going to suggest work on netscape browsers?
3
2131
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, response.redirect to the application. The user ID is stored in a session variable which determines if the user is logged in. When the session var goes...
3
7040
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 that hyperlink does not open the file. When I right click the link, I am able to save the file. I want the file to be opne in browser in a new window....
0
7920
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, 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...
0
7849
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...
0
8215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8347
jinu1996
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...
0
6626
agi2029
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...
1
5718
isladogs
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...
0
5394
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...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2358
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.