944,147 Members | Top Members by Rank

Ad:
Jul 29th, 2005
0

Problem with window.open in Netscape7.2

Expand Post »
I have a code to open new window and display a progress bar .The code works fine in I.E and Netscape4.7 but in Netscape 7.2 it opens a new window and displays nothing in it . Below is my code. Can you please tell me what is wrong in my code.

HTML and CSS Syntax (Toggle Plain Text)
  1. <html>
  2. <script>
  3. var Window02;
  4. var secondWindow = false;
  5. function ProgressBar(sLength) {
  6. var BarLength = 88;
  7. var iLength = parseFloat(sLength);
  8. var Bar = parseInt(iLength);
  9. var Trough = parseInt(BarLength - iLength);
  10. if (secondWindow == false)
  11. {
  12. var theWindow = 'width=700,height=60,left=10,top=20,menubar=0,toolbar=0,location=0,personalbar=0,status=0,scrollbars =0,directories=0,resizable=0';
  13. Window02 = window.open('', 'Wind02', theWindow);
  14. }
  15. if (secondWindow == false)
  16. {
  17. Window02.document.write('<html><body><form name=f1>' +
  18. '<input type="text" size="' + Bar.toString() + '" style="background:blue">' +
  19. '<input type="text" size="' + Trough.toString() + '" style="background:green">' +
  20. 'Page is loading.' +
  21. '</form></body></html>');
  22. secondWindow = true;
  23. Window02.document.close();
  24. }
  25. if (secondWindow == true)
  26. {
  27. Window02.document.write('<html><body><form name=f1>' +
  28. '<input type="text" size="' + Bar.toString() + '" style="background:blue">' +
  29. '<input type="text" size="' + Trough.toString() + '" style="background:green">' +
  30. 'Page is loading.' +
  31. '</form></body></html>');
  32. Window02.document.close();
  33. }
  34. }
  35. function BarRun()
  36. {
  37. for(i=0;i<50;i++)
  38. {
  39. ProgressBar(i);
  40. BarDelay(1000);
  41. }
  42. Window02.close();
  43. secondWindow = false;
  44. }
  45. function BarDelay(msec) {
  46. var enter_date = new Date();
  47. var enter_time = enter_date.getTime();
  48. var leave_date = new Date();
  49. var leave_time = leave_date.getTime(); // a big integer
  50. while (enter_time + msec > leave_time) {
  51. leave_date = new Date(); leave_time = leave_date.getTime(); }
  52. }
  53. </script>
  54. <body>
  55. <form name=f1>
  56. <input type=button value=showProgressbar onClick=BarRun()>
  57. </form>
  58. </body>
  59. </html>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
muktidaniweb is offline Offline
11 posts
since Jul 2005
Jul 30th, 2005
0

Re: Problem with window.open in Netscape7.2

See http://www.pageresource.com/jscript/jwinopen.htm
I believe the line that might interest you is: 'remove any whitespace for netscape'.
Reputation Points: 54
Solved Threads: 20
Master Poster
DaveSW is offline Offline
765 posts
since Jul 2004
Aug 1st, 2005
0

Re: Problem with window.open in Netscape7.2

you need to use Window02.document.open() before there is a valid document to write to in netscape and mozilla.
Reputation Points: 20
Solved Threads: 5
Junior Poster
alpha_foobar is offline Offline
182 posts
since May 2005
Aug 9th, 2005
0

Re: Problem with window.open in Netscape7.2

Thanks for your reply.
I added Window02.document.open() before Window02.document.write
but it doesn't help. If i remove the Window02.close() then I see that after sometime it displays the last position of the progress bar in the window. I read somewhere that this could be a multithreading issue and javascript doenot support multithreading.
Is there any other way a progressbar can be displayed ,it neednot be in a popup window?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
muktidaniweb is offline Offline
11 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in HTML and CSS Forum Timeline: Navigation Bar that extends the length of the page
Next Thread in HTML and CSS Forum Timeline: is it possible? help me





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC