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

Strange Popup JS window behavior

Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro
llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when
I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth
Nov 18 '05 #1
6 1622
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.

I'm wondering if it is a timing thing where the main page is still rendering
its contents and somehow steals back the focus? Maybe there's a delay while
the page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro
llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when
I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


Nov 18 '05 #2
Is there in asp.net any property you can set that tells
the window to stay on top of all other windows?

In JS 1.2 there is a 'alwaysRaised' parameter to
the 'window.open' function, but I can't get that working
either.

/Kenneth
-----Original Message-----
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.
I'm wondering if it is a timing thing where the main page is still renderingits contents and somehow steals back the focus? Maybe there's a delay whilethe page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


.

Nov 18 '05 #3
Perhaps, on this form I call for the JS function with two
calls, one from a button (doesn't work) and one from a
buttoncolumn in a grid (that works).

From the grid's ItemCommand I do:

If e.CommandName = "Change" Then
Page.Register....
End If

and from the Button_Click event I do:

Page.Register...

with identical calls.

What to do?

/Kenneth
-----Original Message-----
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.
I'm wondering if it is a timing thing where the main page is still renderingits contents and somehow steals back the focus? Maybe there's a delay whilethe page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


.

Nov 18 '05 #4
Yes, it was a time delay problem.

I tried to include 'setTimeout' upon calling the JS
function with a delay with 200 ms and it all works just
fine.

/Kenneth
-----Original Message-----
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.
I'm wondering if it is a timing thing where the main page is still renderingits contents and somehow steals back the focus? Maybe there's a delay whilethe page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


.

Nov 18 '05 #5
Glad to hear you made some progress!

"Kenneth" <ke***********@chello.se> wrote in message
news:0c****************************@phx.gbl...
Yes, it was a time delay problem.

I tried to include 'setTimeout' upon calling the JS
function with a delay with 200 ms and it all works just
fine.

/Kenneth


Nov 18 '05 #6
Glad to hear you made some progress!

"Kenneth" <ke***********@chello.se> wrote in message
news:0c****************************@phx.gbl...
Yes, it was a time delay problem.

I tried to include 'setTimeout' upon calling the JS
function with a delay with 200 ms and it all works just
fine.

/Kenneth


Nov 18 '05 #7

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,...
2
by: swp | last post by:
I have a site created using ASP, HTML, and JavaScript. I use frames to manage a few things, and requires SSL to connect. The site is on a secured network, not meant to be cross-browser...
1
by: Sergey Sedzyalo | last post by:
Hello All I have strange error in IE 5.5 - "The server thew an exeption" look code: self.opener.document.frm.categories.options=new Option("1", "1"); Plese help. Thanks.
9
by: Abby Lee | last post by:
http://www.ncsa.uiuc.edu/Divisions/Admin/reimb.asp There is just too much code to place here. onChange you trigger a function to add the numbers in the the column you entered an amount in...
2
by: Targa | last post by:
Im using the code below to pop up a window: It works fine except for that in the titlebar, my domain name is listed before the page title like below: http://mydomain.com - MyPopupwindowname -...
3
by: Phil | last post by:
Does anyone know if a modeless dialog box can be made to stay open when the parent window is closed? Maybe something to do with disabling the parent/owner? I basically need to have a popup...
10
by: korund | last post by:
We can use special characters ('\n') to add line breaks in text in JavaScript popup Alert boxes. there is also few additional special characters: \' single quote \" double quote \&...
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...
1
by: Raffi | last post by:
We have an application that runs in a popup window with custom menus, toolbars etc. The application uses session cookies. We would prefer for the session cookies to be valid only in the popup...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.