Forum Moderators: open

Message Too Old, No Replies

window.open not working

is this sp2 or am i being silly?

         

natty

5:05 pm on Jan 16, 2005 (gmt 0)

10+ Year Member



hi all,

jsut a simple window open is all i want to do..
but the following isnt working

<a href="javascript:mailLink('this@that.com');>email</a>

js is

function mailLink(mailaddr){
var url = "../email.htm"; //?x=" + mailaddr
var newwin = window.open(url, "Email Form", "width=300,height=250,toolbar=false,locationbar=false,directories=false,status=true,menubar=false,scrollbars=false,resizable=false,copyhistory=false");
}

ignore the mailaddr bit, as i was hoping to open an asp page that would grab the mail address from the querystring.. but as i couldnt even get the first bit to work, i commented it out.
also tried with a non relative url, with no luck either.

i tried with and without doing the newin = ...

am i missing something blatant? this is usually the way with me ..

tia

nat

Bernard Marx

5:22 pm on Jan 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's some blatantly dodgy quoting going on here:

"../email.htm"; //?x=" + mailaddr

natty

5:33 pm on Jan 16, 2005 (gmt 0)

10+ Year Member



hi bernard,

the second half of that line is commented..?

but took it off still no joy

Bernard Marx

5:54 pm on Jan 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



D'oh! Too right. My mistake.
Better look again.

Bernard Marx

6:03 pm on Jan 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



(The closing quote is missing on the href you gave, but I guess that was just in the pasting process.)

The actual problem seems to stem from having a space in the window name
(2nd arg: "Email Form").

Turn that into "EmailForm" and it seems to be OK again. (IE6 win 2000).

natty

8:39 pm on Jan 16, 2005 (gmt 0)

10+ Year Member



thanks again bernard,

you are always a massive help.

out of interest, where did you find that solution, on microsoft somewhere?

i always do a google search, and tried with no luck.

cheers,

nat

JAB Creations

7:12 am on Jan 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I am correct you're just doing this to avoid spambots from seeing mailto correct?

If this is the reason (only one I can think of) then I should make you aware that this may only stop some email harvesting bots but not all.

The only way to completely and utterly avoid keeping your email address from spambots on your site is to have your email address server side. That means you need to setup a contact form.

natty

10:17 am on Jan 17, 2005 (gmt 0)

10+ Year Member



hi jab,

as it goes, i was doing the window.open to open up a little email form..
admitidly having the email address in the html to be passed to the meail form , is a bit pants, considering the spambottiness..
but i was somewhat rushed for time..

the initial plan was to have the email popup form as an asp page, that would get passed the email address in the querystring, so i could use the same form with all the email links on the site..

well that was the idea anyway..

thanks again all for the help

nat