| | |
javascript know whether a window is opened or not
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi
I am doing a chating application.I want to know whether a window is opened or not.
This is the code i am using to open a window.
later i trying whether the window is already opened or not.
for win.closed it is giving javascript error like "closed is null or not an object".
I am using IE7.
Please h on this.
Thanks in Advance
Venki
I am doing a chating application.I want to know whether a window is opened or not.
This is the code i am using to open a window.
JavaScript Syntax (Toggle Plain Text)
var title='Chat_'+userId+"_"+selectedUserId; var url="OneToOneChat.aspx?FromUserId="+userId+"&FromUserName="+userName+"&ToUserId="+selectedUserId+"&ToUserName="+selectedUserName; window.open(url,title,'width=410,height=400,toolbar=no,menubar=no,scrollbars=no,status=yes',false);
later i trying whether the window is already opened or not.
JavaScript Syntax (Toggle Plain Text)
var win='Chat_'+userId+"_"+selectedUserId; if(win.closed) { } else { }
I am using IE7.
Please h on this.
Thanks in Advance
Venki
Last edited by peter_budo; Jun 3rd, 2009 at 1:16 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Jun 2009
Posts: 11
Reputation:
Solved Threads: 1
Oh i think problem might be u r opening the window w/o assigning it to a variable.....fifth line above should be:
var win=window.open(url,title,'width=410,height=400,toolbar=no,menubar=no,scrollbars=no,status=yes',false);
There is no need for new win var in the second javascript code and u can directly for win.closed.
var win=window.open(url,title,'width=410,height=400,toolbar=no,menubar=no,scrollbars=no,status=yes',false);
There is no need for new win var in the second javascript code and u can directly for win.closed.
![]() |
Similar Threads
- javascript:window.open not working for internet explorer (PHP)
- disable parent window (JavaScript / DHTML / AJAX)
- Javascript Window Swap and IE6 (JavaScript / DHTML / AJAX)
- popup window not working in javascript (JavaScript / DHTML / AJAX)
- new window popup (HTML and CSS)
- JavaScript's window.opener (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Pass a url parameter to a FrontPage Form
- Next Thread: Send list element with a particular class to a form?
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box browser bug calendar captchaformproblem cart checkbox close codes column createrange() css cursor date debugger decimal dependent design dom download dropdown element embed enter error events firefox focus form frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 iframe images index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsfile jsp libcurl listbox maps masterpage media menu microsoft mimic mp4 onmouseover paypal php player position post problem programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c website window windowofwords windowsxp





