Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   popup not poping (http://www.velocityreviews.com/forums/t80602-popup-not-poping.html)

Buz Waitz 06-15-2004 10:18 PM

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



Cristian Suazo 06-16-2004 12:17 AM

Re: popup not poping
 
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" <bwaitz@sbcglobal.net> wrote in message
news:OqJECbyUEHA.3200@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
>
>




bloomfield 06-16-2004 08:06 AM

Re: popup not poping
 
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
>
>


Hans Kesting 06-16-2004 08:13 AM

Re: popup not poping
 

"Buz Waitz" <bwaitz@sbcglobal.net> wrote in message news:OqJECbyUEHA.3200@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



Eliyahu Goldin 06-16-2004 09:02 AM

Re: popup not poping
 
Buz,

window.showModalDialog (..);

Eliyahu

"Buz Waitz" <bwaitz@sbcglobal.net> wrote in message
news:OqJECbyUEHA.3200@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
>
>




Buz Waitz 06-16-2004 03:40 PM

Re: popup not poping
 
the return false did it. thanks!

"Buz Waitz" <bwaitz@emailsbcglobal.net> wrote in message
news:OqJECbyUEHA.3200@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
>
>





All times are GMT. The time now is 10:02 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.