| | |
Parent/Child Windows
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
> This still isn't working. Can someone help?
I am sorry to say this, but you have lost the ability to see things as they are. My first post pointed out the mistakes in your code, my second post was a piece of working code and you still come back and say it isn't working?
If you plan on ignoring our posts and advice, do let us know in advance.
I am sorry to say this, but you have lost the ability to see things as they are. My first post pointed out the mistakes in your code, my second post was a piece of working code and you still come back and say it isn't working?
If you plan on ignoring our posts and advice, do let us know in advance.
I don't accept change; I don't deserve to live.
•
•
Join Date: Jul 2007
Posts: 13
Reputation:
Solved Threads: 0
I am sorry. Maybe you missed what I said.
Your code did work fine, but only for one window, not 3. We have 3 windows that the user may choose to have open at the same time. That is why I needed to make a change. I did say that I am a novice and what seems obvious to you is extremely difficult for me. Not only did I NOT ignore you, I also took the advice from the other person and changed 'name' to theName. I must have something wrong, but for the life of me, I can't find it.
Your code did work fine, but only for one window, not 3. We have 3 windows that the user may choose to have open at the same time. That is why I needed to make a change. I did say that I am a novice and what seems obvious to you is extremely difficult for me. Not only did I NOT ignore you, I also took the advice from the other person and changed 'name' to theName. I must have something wrong, but for the life of me, I can't find it.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<SCRIPT> <!-- // create a custom window function openWindow(url, wnd) { var theName = null; theName = wnd; if (!theName || theName.closed) { var windowHeight,windowWidth,windowTop,windowLeft windowHeight = screen.availHeight; windowWidth = screen.availWidth; windowTop = 0; windowLeft = 0; var varStore = ""; varStore = varStore + "width=" + windowWidth; varStore = varStore + ",height=" + windowHeight; varStore = varStore + ",resizable=" + "1"; varStore = varStore + ",scrollbars=" + "0"; varStore = varStore + ",menubar=" + "0"; varStore = varStore + ",toolbar=" + "0"; varStore = varStore + ",directories=" + "0"; varStore = varStore + ",location=" + "0"; varStore = varStore + ",status=" + "1"; varStore = varStore + ",left=" + windowLeft; varStore = varStore + ",top=" + windowTop; varStore = varStore + ",ScreenX=" + windowLeft; varStore = varStore + ",ScreenY=" + windowTop; window.open(url,theName,varStore) } else { theName.focus(); } } //--> </SCRIPT>
So maybe next time you should place the entire requirement instead of letting us guess whether you want 2 or 3 windows....
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script> var wnd = new Array(); function openit(id) { if(!wnd[id] || wnd[id].closed) wnd[id] = window.open("http://www.google.com"); else wnd[id].focus(); } </script> </head> <body> <form> <input type="button" value="Open1" onclick="openit(0);" /><br/> <input type="button" value="Open2" onclick="openit(1);" /><br/> <input type="button" value="Open3" onclick="openit(2);" /><br/> </form> </body> </html>
I don't accept change; I don't deserve to live.
•
•
Join Date: Jul 2007
Posts: 13
Reputation:
Solved Threads: 0
I want to thank you, albeit you were not very friendly, you did continue to help me through creating a successful script. I finally narrowed down the problem to the code regarding the varible for the window attributes (see earlier samples). You did not include that in your second working sample. Normally that code works fine, but not with the code you created. Thanks again!
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<script> var wnd = new Array(); function openWindow(url,id) { if(!wnd[id] || wnd[id].closed) wnd[id] = window.open(url,"","width=screen.availWidth,height=screen.availHeight,resizable=1,scrollbars=0,menubar=0,toolbar=0,directories=0,location=0,status=1,left=0,top=0,ScreenX=0,ScreenY=0"); else wnd[id].focus(); } </script>
The code you pasted above seems to be working for me. What problems do you experience?
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script> var wnd = new Array(); function openWindow(url,id) { if(!wnd[id] || wnd[id].closed) wnd[id] = window.open(url,"" + id, "width=" + screen.availWidth + ",height=" + screen.availHeight + ",resizable=1,scrollbars=0,menubar=0,toolbar=0,directories=0," + "location=0,status=1,left=0,top=0,ScreenX=0,ScreenY=0"); else wnd[id].focus(); } </script> </head> <body> <input type="button" value="Button1" onclick="openWindow('http://www.google.com', 1);" /> <input type="button" value="Button2" onclick="openWindow('http://www.google.com', 2);" /> <input type="button" value="Button3" onclick="openWindow('http://www.google.com', 3);" /> </body> </html>
Last edited by ~s.o.s~; Aug 3rd, 2007 at 12:44 pm.
I don't accept change; I don't deserve to live.
![]() |
Similar Threads
- Parent/Child Windows References (JavaScript / DHTML / AJAX)
- how can I fix two child windows in a mdi form in vb 4 (Visual Basic 4 / 5 / 6)
- ASP.NET 2.0, Parent/Child Data Control? (ASP.NET)
- Displaying a different bitmap in different child windows? - win32 in C (C)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Javascript Function Link
- Next Thread: loader page
| Thread Tools | Search this Thread |
acid2 ajax ajaxexample ajaxhelp ajaxjspservlets animate array automatically beta box browser captchaformproblem cart child close codes column css date debugger decimal dependent design disablefirebug dom download element embed engine enter error events ext file firefox focus form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe index java javascript javascripthelp2020 jawascriptruntimeerror jquery jsp jump libcurl listbox maps masterpage math media menu microsoft mimic mp4 onmouseoutdivproblem onmouseover onreadystatechange paypal pdf php player position post problem programming prototype redirect safari scale scriptlets scroll search security select software sql toggle unicode variables w3c web website window windowofwords \n






