Popup window not working properly in IE6

T

Terren

The following code is not working properly in IE6 but it does work for
mozilla firefox.

I am trying to open a new popup window without affecting the frame from
"where" it came. But what happens when I click on the link is that the
popup window is displayed correctly but the frame then changes to my
default.htm. It is supposed to stay the same

here is my code

Response.Write "<td><a href=" & """" & """" & " onclick=" & """" &
"javascript:window.open('desc.asp?msg=" & tempdesc & "','" & rownum &
"','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=600,height=600,left=300,top=300')"
& """" & ">" & left(tempdesc,50) & "....</a></td>"
 
P

Patrice

What if you try # instead of an empty string for the href attribute ?
Or if you cancel the event ?

I believe that IE6 goes to / because of the empty string for href...
 
D

Dave Anderson

Patrice said:
What if you try # instead of an empty string for the href
attribute ? Or if you cancel the event ?

Just an aside, but this is one of my pet peeves. If the user has scrolled
the page at all, clicking on such a link will not merely fire the onclick
handler, it will also return him to the top of the page.

The proper solution here is to either *stop* using <a href>...

<input type="button" onclick="dosomething()" ...>
<span onclick="doSomething"> ... </span>

....or at least cancel the click event:

<a href="" onclick="doSomething();return false"> ... </a>




--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
T

Terren

Yes, you are right but I had to use href because I have a table full of
these. Basically it is a table with abbreviated descriptions that
"link" to the full description in the popup window. So it wouldn't look
to good if I had 100's of buttons and I don't know how readable it
would be as well because the abbreviation is 50 characters long

I think I will cancel the event though.

Thanks for all your guys help, I am well on my way to becoming a
mediocore web programmer
 
T

Terren

I can see you are very wise, you forsore some problems that I did
experience, i.e with quotes,breaks. I setup another asp page with some
general functions that would replace the breaks with <br> and the quote
and other characters with alternatives but then I thought that this is
crazy because I can't cater for
every possible problem character. So what I am going to do now is pass
the primary key for the relavant record and then I will get the
description straight from the database in the popup window.
 
D

Dave Anderson

Terren said:
...this is crazy because I can't cater for every possible
problem character. So what I am going to do now is pass the
primary key for the relavant record and then I will get the
description straight from the database in the popup window.

That was the solution I was hoping you would see.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top