Not loaded HTML document in some cases

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

Hi!
I have a problem using HTML Document DOM: in the DocumentComplete event handler I'm trying to access DOM elements and I receive an error: no such field. This happens not every time, but sometimes, rarely enough to keep it as it is, but still I would like to understand where the problem is and fix it.

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

The HTML document might be completed, but not yet ready, for example when it is reloaded while it was not loaded fully yet. You need to check if document's readyState is equal to "complete":

Code
If Items.HTMLDocument.Document.readyState = "complete" Then
   // your code
EndIf;

 
#3
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

That's interesting... Thank you!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.