User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,658 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,376 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 745 | Replies: 6
Reply
Join Date: Apr 2007
Location: Birmingham
Posts: 368
Reputation: Fungus1487 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 35
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Question anything wrong with this simple code

  #1  
Jun 6th, 2007
i only need this to work in i.e. and im sure it does but i am getting a "closed is null or not an object" exception message

declared in HEAD::

<script type="text/javascript">
  function reloadwin(w){
    if (w.closed) alert('window is closed')
    else return setTimeout('reloadwin()', 500)
  }
</script>


called in BODY

<script language='javascript'>reloadwin(w)</script>
Last edited by Fungus1487 : Jun 6th, 2007 at 7:44 am.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2007
Location: Birmingham
Posts: 368
Reputation: Fungus1487 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 35
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Question Re: anything wrong with this simple code

  #2  
Jun 6th, 2007
Originally Posted by Fungus1487 View Post
i only need this to work in i.e. and im sure it does but i am getting a "closed is null or not an object" exception message

declared in HEAD::

<script type="text/javascript">
  function reloadwin(w){
    if (w.closed) alert('window is closed')
    else return setTimeout('reloadwin()', 500)
  }
</script>


called in BODY

<script language='javascript'>reloadwin(w)</script>

and sorry i call the window using this

<script language='javascript'>
  w=window.open('CIPFATree.aspx', 'CIPFA', 
  'width=360, height=160, status=yes, menubar=no, resizable=yes,
  'scrollbars=yes');
</script>
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,805
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 338
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: anything wrong with this simple code

  #3  
Jun 6th, 2007
You need to post the entire code as it is for someone to help you out. Posting in bits and pieces would just make it difficult.

And BTW, that kind of error is normally given when the variable 'w' doesn't refer to any window, i.e. function is called before window is created.
Last edited by ~s.o.s~ : Jun 6th, 2007 at 12:32 pm.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Apr 2007
Location: Birmingham
Posts: 368
Reputation: Fungus1487 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 35
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Re: anything wrong with this simple code

  #4  
Jun 6th, 2007
very sorry. here we go.

<HTML>
  <HEAD>
  <script type="text/javascript">
    function reloadwin(w){
      if (w.closed) alert('window is closed')
      else return setTimeout('reloadwin()', 500)
    }
  </script>
  </HEAD>
  <BODY>
    <script language='javascript'>
      w=window.open('CIPFATree.aspx', 'CIPFA', 
          'width=360, height=160, status=yes, 
          menubar=no, resizable=yes,
          'scrollbars=yes');
      reloadwin(w);
</script>
  </BODY>
</HTML>
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,805
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 338
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: anything wrong with this simple code

  #5  
Jun 6th, 2007
You forgot to pass 'w' to the function passed in the setTimeout().
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Apr 2007
Location: Birmingham
Posts: 368
Reputation: Fungus1487 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 35
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Re: anything wrong with this simple code

  #6  
Jun 6th, 2007
i love you
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,805
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 338
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: anything wrong with this simple code

  #7  
Jun 6th, 2007
Happy coding.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:35 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC