473,320 Members | 1,612 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,320 software developers and data experts.

popup not poping

I have tried several different versions of javascript to pop up a window
from an aspx page. The problem is, that the new page pops up in the current
window, not in a popup. The code works in a regular HTML page, using
Dreamweaver. I've also used code generators, tried by hand, you name it.
Same result. Here's one version of code I used:

<script language="javascript" type="text/javascript">
<!--
function PT_poppwin(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=1,width=300 ,height=600');
}
//-->
</script>

<a href="listsinfo.aspx" onMouseDown="PT_popwin('listsinfo.aspx','Lists')">
Lists</a>

Any suggestions on how to pop open a new window? Thanks.

Buz
Nov 18 '05 #1
5 1347
Hi Buz,

try adding return false after your function PT_popwin or that you return
false from your function PT_popwin always. Like this:

**************************
script language="javascript" type="text/javascript">
<!--
function PT_poppwin(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=1,width=300 ,height=600');
return false;
}
//-->
</script>

<a href="listsinfo.aspx" onMouseDown="return
PT_popwin('listsinfo.aspx','Lists')">Lists</a>

**************************
or like this:

<a href="listsinfo.aspx" onMouseDown="return
PT_popwin('listsinfo.aspx','Lists');return false;">Lists</a>
Hope this is useful to you
Cheers
Cristian


"Buz Waitz" <bw****@sbcglobal.net> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl...
I have tried several different versions of javascript to pop up a window
from an aspx page. The problem is, that the new page pops up in the current window, not in a popup. The code works in a regular HTML page, using
Dreamweaver. I've also used code generators, tried by hand, you name it.
Same result. Here's one version of code I used:

<script language="javascript" type="text/javascript">
<!--
function PT_poppwin(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=1,width=300 ,height=600');
}
//-->
</script>

<a href="listsinfo.aspx" onMouseDown="PT_popwin('listsinfo.aspx','Lists')"> Lists</a>

Any suggestions on how to pop open a new window? Thanks.

Buz

Nov 18 '05 #2
Buz,

window.showModalDialog (..);

Eliyahu

"Buz Waitz" <bw****@sbcglobal.net> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl...
I have tried several different versions of javascript to pop up a window
from an aspx page. The problem is, that the new page pops up in the current window, not in a popup. The code works in a regular HTML page, using
Dreamweaver. I've also used code generators, tried by hand, you name it.
Same result. Here's one version of code I used:

<script language="javascript" type="text/javascript">
<!--
function PT_poppwin(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=1,width=300 ,height=600');
}
//-->
</script>

<a href="listsinfo.aspx" onMouseDown="PT_popwin('listsinfo.aspx','Lists')"> Lists</a>

Any suggestions on how to pop open a new window? Thanks.

Buz

Nov 18 '05 #3
I guess it has something to do with the wrong function name
in script: PT_poppwin
in href: PT_popwin

I also recomand using
onclick="PT_popwin('listsinfo.aspx','Lists'); return false;"
and not onMouseDown

Buz Waitz wrote:
I have tried several different versions of javascript to pop up a window
from an aspx page. The problem is, that the new page pops up in the current
window, not in a popup. The code works in a regular HTML page, using
Dreamweaver. I've also used code generators, tried by hand, you name it.
Same result. Here's one version of code I used:

<script language="javascript" type="text/javascript">
<!--
function PT_poppwin(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=1,width=300 ,height=600');
}
//-->
</script>

<a href="listsinfo.aspx" onMouseDown="PT_popwin('listsinfo.aspx','Lists')">
Lists</a>

Any suggestions on how to pop open a new window? Thanks.

Buz

Nov 18 '05 #4

"Buz Waitz" <bw****@sbcglobal.net> wrote in message news:Oq**************@TK2MSFTNGP10.phx.gbl...
I have tried several different versions of javascript to pop up a window
from an aspx page. The problem is, that the new page pops up in the current
window, not in a popup. The code works in a regular HTML page, using
Dreamweaver. I've also used code generators, tried by hand, you name it.
Same result. Here's one version of code I used:

<script language="javascript" type="text/javascript">
<!--
function PT_poppwin(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=1,width=300 ,height=600');
}
//-->
</script>

<a href="listsinfo.aspx" onMouseDown="PT_popwin('listsinfo.aspx','Lists')">
Lists</a>

Any suggestions on how to pop open a new window? Thanks.

Buz


Possibly a typing error in your post, but I noticed that the function definition
uses PT_poppwin (double p), and that you call PT_popwin (single p).

The current window gets changed because of the "href". As others replied,
you need to add "return false" to the event handler:
<a ... onMouseDown="PT_popwin('listsinfo.aspx','Lists'); return false">

Hans Kesting
Nov 18 '05 #5
the return false did it. thanks!

"Buz Waitz" <bw****@emailsbcglobal.net> wrote in message
news:Oq**************@TK2MSFTNGP10.phx.gbl...
I have tried several different versions of javascript to pop up a window
from an aspx page. The problem is, that the new page pops up in the current window, not in a popup. The code works in a regular HTML page, using
Dreamweaver. I've also used code generators, tried by hand, you name it.
Same result. Here's one version of code I used:

<script language="javascript" type="text/javascript">
<!--
function PT_poppwin(theURL,winName) { //v2.0
window.open(theURL,winName,'scrollbars=1,width=300 ,height=600');
}
//-->
</script>

<a href="listsinfo.aspx" onMouseDown="PT_popwin('listsinfo.aspx','Lists')"> Lists</a>

Any suggestions on how to pop open a new window? Thanks.

Buz

Nov 18 '05 #6

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

Similar topics

1
by: Noozer | last post by:
When using the WebBrowser control, is it possible to cause popup windows to appear within the WebBrowser control itself instead of a new window? This is what I've written in the NewWindow2 event,...
1
by: CG | last post by:
Hi, I have an ASP application. On one of my pages I have a link to a popup. This popup has a link. When the user clicks this link my popup closes and another Popup is displayed. In this...
1
by: Ben Wan | last post by:
I got 2 error from the following code below... 1. I couldn't load up the picture since the picture is at (C:\company\image\largePic.jpg) 2. I got a page error in my 'index.html' when calling...
15
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...
4
by: Satya | last post by:
I am trying to display a PDF file (which I am being passed from a web service as a binary stream) in a browser, but I am being prompted to save the file instead. I don't want the user to be...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
4
by: jobs | last post by:
the javascript: function ShowTooltip(L1in) { document.getElementById("L1").innerText=L1in; y = event.clientY + document.documentElement.scrollTop; var Popup= document.getElementById("Popup")...
11
by: KRUNOPOPOVIC | last post by:
Hello, This code give me "deque empty before pop" error with visual c++ express in debug configuration mode. Why poping empty stack doesn't throw exception ? Uncommenting the line solves...
1
by: Mike1961 | last post by:
Hi everyone. I have problem with this function javascript: var popup = null; function OpenPopup(fld, tbl, col, w, h) { var pw = Math.floor((screen.width - w) / 2);
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.