473,511 Members | 17,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Popup window not working properly in IE6

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=n o,menubar=no,scrollbars=yes,resizable=no,width=600 ,height=600,left=300,top=300')"
& """" & ">" & left(tempdesc,50) & "....</a></td>"

Sep 26 '05 #1
7 2755
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...

--
Patrice

"Terren" <pa**@legalperfect.co.za> a écrit dans le message de
news:11*********************@g14g2000cwa.googlegro ups.com...
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=n o,menubar=no,scrollbars=ye
s,resizable=no,width=600,height=600,left=300,top=3 00')" & """" & ">" & left(tempdesc,50) & "....</a></td>"

Sep 26 '05 #2
Thanks that worked. It is always the simple things

*** Sent via Developersdex http://www.developersdex.com ***
Sep 26 '05 #3
Patrice wrote:
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.
Sep 26 '05 #4
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

Sep 27 '05 #5
Terren wrote:
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...


Well...button is but one possibility. A small graphic can be just as useful.

Nevertheless, there is another approach, and it's probably a better one. You
can *use* the HREF attribute:

<a href="desc.asp?msg="<%=tempdesc%>"
target="win<%=rownum%>"
onclick="window.open('','win<%=rownum%>',...)">

The key here is matching the TARGET name to a window name. No need to pass
the URL via script, and if scripting should err, it will *still* open in a
new window.

Incidentally, there is no need to list the window attributes you do not
want, nor to use yes/no. This is sufficient:

window.open(...,...,"width=600,height=600,left=300 ,top=300,scrollbars")

A little reading helps:

"When the sFeatures parameter is specified, the features that
are not defined in the parameter are disabled. Therefore, when
using the sFeatures parameter, it is necessary to enable all
the features that are to be included in the new window. If the
sFeatures parameter is not specified, the window features
maintain their default values. In addition to enabling a
feature by setting it to a specific value, simply listing the
feature name also enables that feature for the new window."

http://msdn.microsoft.com/workshop/a...ods/open_0.asp
One last thing -- you seem to be passing the entire description in your
querystring. What happens if that description includes line breaks, quotes,
or other characters that might break your URL?

--
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.
Sep 27 '05 #6
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.

Sep 28 '05 #7
Terren wrote:
...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.
Sep 28 '05 #8

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

Similar topics

8
1948
by: Bijoy Naick | last post by:
It seems like the BBC sports site is able to get past popup blockers.. For eg.. http://news.bbc.co.uk/sport1/hi/cricket/default.stm. Click on the Video icon under "Watch and Listen" - right hand...
1
2819
by: Bill H | last post by:
I run a dbms application that interfaces with the web. This module creates a frames page with two frames ('main' and 'mwinfoframe'). All communication with the dbms is routed through the...
15
18696
by: | last post by:
So many websites can get around my Googlebar's popup blockers. Even Opera 8 can not stop those popups. I looked into the codes, and I can find nothing showing me how it is done. Can anyone help me...
23
6366
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
3
3781
by: Bob | last post by:
I am trying to create a popup page (to act as a menu) from a parent page. When the parent page (index.jsp) calls my popup function (see below) it will properly open the correct size browser window...
5
2837
by: Hemanth | last post by:
Hello there, I'm running a script that opens a popup window (which is basically a form with checkboxes and a submit button). When I click the submit button I want to run a PHP script and target...
0
435
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand...
4
10001
by: Ali | last post by:
i am using visual studio 2005 and I am trying to create a popup calender so when a user click on a image on the main form, a calender will then popup, the user will select a date and the date will...
15
10054
by: H00ner | last post by:
Hello All Hope you can help Been pulling my hair out about a popup problem in ASP.NET. One of the forms i wrote requires the user to select a product from a list in a popup web form. the...
0
7245
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
7512
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...
0
5671
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,...
1
5069
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...
0
4741
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...
0
3227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3214
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1577
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 ...
0
449
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.