Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Document.getElementByID returning NULL
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01663647
Message ID:
01663677
Views:
56
Couple of things:

* Always make sure the document is loaded before accessing things within it.
* You'll probably want to ensure you're using a recent version of IE so that script code works

I think in your

Here's a white paper about Web Browser integration in FoxPro from last year's southwest fox:
Advanced Scenarios for using the Web Browser Control in Visual FoxPro

Lots of useful info there as well as a base control in the samples that provides common helper functions for use with the Web Browser control.
+++ Rick ---

>Hi All,
>
>Even though I have done this a hundred times before, it seems to always comes back to bite me. I have HTML page with a tag with the id='count'. when I load it into the WebBrowser control and attempt to reference the tag the returned reference is NULL.
>
>HTML code
>
>... <td id='count'>123</td>
>
>
>VFP code
>
>loID = loForm.IE.document.getElementById( "count" )
>? loID        && displays .NULL.
>
>
>I can see it in the Source View, and even in the browser Debug Console, but can not get the object reference via code in VFP. Is there a secret I am missing?
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform