Problem with window.open in Netscape7.2

Reply

Join Date: Jul 2005
Posts: 11
Reputation: muktidaniweb is an unknown quantity at this point 
Solved Threads: 0
muktidaniweb muktidaniweb is offline Offline
Newbie Poster

Problem with window.open in Netscape7.2

 
0
  #1
Jul 29th, 2005
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>
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 764
Reputation: DaveSW is on a distinguished road 
Solved Threads: 17
DaveSW's Avatar
DaveSW DaveSW is offline Offline
Master Poster

Re: Problem with window.open in Netscape7.2

 
0
  #2
Jul 30th, 2005
See http://www.pageresource.com/jscript/jwinopen.htm
I believe the line that might interest you is: 'remove any whitespace for netscape'.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: Problem with window.open in Netscape7.2

 
0
  #3
Aug 1st, 2005
you need to use Window02.document.open() before there is a valid document to write to in netscape and mozilla.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 11
Reputation: muktidaniweb is an unknown quantity at this point 
Solved Threads: 0
muktidaniweb muktidaniweb is offline Offline
Newbie Poster

Re: Problem with window.open in Netscape7.2

 
0
  #4
Aug 9th, 2005
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



Tag cloud for HTML and CSS
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC