Internet Development

Moderators: None (Apply to moderate this forum)
Number of threads: 1024
Number of posts: 1892

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Database loading Posted by mac_doggie on 28 Dec 2001 at 8:27 AM
I have several XML databases that need to be loaded.
I use the following code to do this:

  var xmlDoc = new ActiveXObject("microsoft.xmldom"); 
  xmlDoc.load("GebruikersDatabase.xml"); 
  alert('UserDatabase is being loaded...'); 

  if(xmlDoc.readyState != 4) { 
    alert('UserDatabse could not be loaded.'); 
    return; 
  } 


if I use this code it works alright, but it is very irritating that the alertbox appeares every time the database is being loaded. When I remove the first alertbox it still works on my own PC but when I upload the files to the Internet it doesn't work anymore.

First I thought there wasn't enought time for the database to be loaded, so I replaced the first alertbox with:
  for(x=0;x<100000;x++){
  }

but this didn't work either. Until now I still only have the alertbox as alternative.

Does anyone now how I could do this simple thing without this stupid anoying alertbox...???

please help me if you can because I'm going mad...

(I've also placed this thread in the XML messagelist but noone seems to read those threads... so I hope you guys/girls can help me out...)



<br>
-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...

Report
Re: Database loading Posted by Tim Thacker on 4 Jan 2002 at 7:04 AM
Why not:

Do While xmlDoc.ReadyState != 4
'Do nothing
loop


Tim


: I have several XML databases that need to be loaded.
: I use the following code to do this:
:
:
:   var xmlDoc = new ActiveXObject("microsoft.xmldom"); 
:   xmlDoc.load("GebruikersDatabase.xml"); 
:   alert('UserDatabase is being loaded...'); 
: 
:   if(xmlDoc.readyState != 4) { 
:     alert('UserDatabse could not be loaded.'); 
:     return; 
:   } 
: 

:
: if I use this code it works alright, but it is very irritating that the alertbox appeares every time the database is being loaded. When I remove the first alertbox it still works on my own PC but when I upload the files to the Internet it doesn't work anymore.
:
: First I thought there wasn't enought time for the database to be loaded, so I replaced the first alertbox with:
:
:   for(x=0;x<100000;x++){
:   }
: 

: but this didn't work either. Until now I still only have the alertbox as alternative.
:
: Does anyone now how I could do this simple thing without this stupid anoying alertbox...???
:
: please help me if you can because I'm going mad...
:
: (I've also placed this thread in the XML messagelist but noone seems to read those threads... so I hope you guys/girls can help me out...)
:
:
:
:
: -mac-
: mailto:programmersheaven@mac-doggie.nl
: the Netherlands...
:
:

Report
Re: Database loading Posted by mac_doggie on 4 Jan 2002 at 8:15 AM
Thanks for your reaction Tim,

I tried this with and without the setTimeout:

	
   while(xmlDoc2.readyState != 4) {
     var ID = window.setTimeout(";",1000); // Just wait and do nothing
   };



but When I run it without setTimeOut I can wait until next year but iExplorer just doesn't react anymore. And if I run it with setTimeOut The function doesn't go any further I also tried a window.setInterval but that didn't work either...


HELP!!!!!




-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...


Report
Re: Database loading Posted by Tim Thacker on 4 Jan 2002 at 8:22 AM
Let me see if I can get some free time this weekend to play with it. I'll let you know on Monday.

Tim

: Thanks for your reaction Tim,
:
: I tried this with and without the setTimeout:
:
:
	
:    while(xmlDoc2.readyState != 4) {
:      var ID = window.setTimeout(";",1000); // Just wait and do nothing
:    };
: 
: 

:
: but When I run it without setTimeOut I can wait until next year but iExplorer just doesn't react anymore. And if I run it with setTimeOut The function doesn't go any further I also tried a window.setInterval but that didn't work either...
:
:
: HELP!!!!!
:
:
:
:
: -mac-
: mailto:programmersheaven@mac-doggie.nl
: the Netherlands...
:
:
:

Report
Re: Database loading Posted by mac_doggie on 4 Jan 2002 at 8:51 AM
Thanxx I'd really apreciate that...


: Let me see if I can get some free time this weekend to play with it. I'll let you know on Monday.


-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...


Report
Re: Database loading Posted by Tim Thacker on 7 Jan 2002 at 6:48 AM
OK I ran into the same problems that you were having. It worked with and without the alert box popping. But the readyastate would not work inside the Do...Loop. Are you trying to load muliple XML files? If so check whether you want async set to true or false. DevGuru.com has a pretty good API on it. http://www.devguru.com/Technologies/xmldom/quickref/document_async.html. This will allow you to control whether processing haults while the file is loaded or continues.

Hope this helps.

Tim


: Thanxx I'd really apreciate that...
:
:
: : Let me see if I can get some free time this weekend to play with it. I'll let you know on Monday.
:
:
: -mac-
: mailto:programmersheaven@mac-doggie.nl
: the Netherlands...
:
:
:

Report
Re: Database loading Posted by mac_doggie on 8 Jan 2002 at 1:34 PM
Yes, yes yes. Thank you, you've realy helped me.
It works...



: OK I ran into the same problems that you were having. It worked with and without the alert box popping. But the readyastate would not work inside the Do...Loop. Are you trying to load muliple XML files? If so check whether you want async set to true or false. DevGuru.com has a pretty good API on it. http://www.devguru.com/Technologies/xmldom/quickref/document_async.html. This will allow you to control whether processing haults while the file is loaded or continues.
:
: Hope this helps.
:
: Tim
:
:
: : Thanxx I'd really apreciate that...
: :
: :
: : : Let me see if I can get some free time this weekend to play with it. I'll let you know on Monday.
: :
: :
: : -mac-
: : mailto:programmersheaven@mac-doggie.nl
: : the Netherlands...
: :
: :
: :
:
:


-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.