Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
HTML Dom - web browser control
Message
From
27/09/2005 11:13:56
 
 
To
27/09/2005 09:37:45
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
01053216
Message ID:
01053453
Views:
16
>>>Greetings,
>>>
>>>I'm working on an HTML integration utility. The goal is to load an HTML page into the web browser object in VFP and then trap the link the user clicks on so I can save the link source and do some extra processing before sending the user to the next page.
>>>
>>>I'm got the page loaded fine and I can grab all the tags by using the getelementsbytagname method. I can loop through the tag elements using the following code:
>>>
>>>
>>>loNodes = o.Document.getElementsByTagName("A")
>>>
>>>FOR EACH loNode IN loNodes
>>>
>>>  *** Need code here to assign onclick event?
>>>
>>>ENDFOR
>>>
>>>
>>>
>>>Does anyone know the code that I need to write inside this loop to setup the onclick so I can trap it in VFP?
>>>
>>>Thanks in advance for the help!!!
>>
>>If I understand you right, you can place your VFP code in the web browser object's BeforeNavigate event. This event is called whenever the user clicks a link or submits a page.
>>
>>see
http://www.glrsoftware.com/download/download.asp?file=FoxHTML.zip for examples of this being used.
>
>Thanks a bunch for the help. The beforenavigate2 event has got me 90% of the way to where I need to be. I downloaded and tried to use the sample FOxHTML.zip but I"m getting an error: "Trying to revoke a drop target that has not been registered." Some of the code in this sample looks like it could be very helpful. Any idea how I could fix this error?

I am glad it helps. But, about the error. I do not seem to get the error you are reporting. I have looked at the code, but do not see anything that stands out that would cause the error. It should not be an issue to using the BeforeNavigate2 event.

>
>Now for the bonus questions!!
>1. Any idea how I could highlight the links that have been clicked on?

Only way I can think of is to use a little Javascript and change the Anchor background color in the HTML.

>2. Is there a way to get a reference in VFP to the object (node) that has been clicked?
>

I would suggest using your original idea and search the Anchor nodes for the node that references the link that is passed in the URL parameter of the BeforeNavigate2 event.

>Thanks again for the help!
Greg Reichert
Previous
Reply
Map
View

Click here to load this message in the networking platform