ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old February 4th, 2004, 02:08 PM
tngaijin tngaijin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 16 tngaijin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
ActiveX Webbrowser control vs Javascript

I am writing an automated webbrowser using the ActiveX webbrowser object. The point is that I have a bunch of stuff in my own database which needs to get to someone else's database but they won't allow me to access the DB in any other way than their webpage. The problem I am encountering is that at one point they pop a javascript alert via an onLoad function no matter what. What I would like to be able to do is have my automated browser click "OK" on any popped javascript alerts, and also be able to choose "OK" or "Cancel" on any javascript asserts but I haven't been able to find any books or tutorials on webbrowser control and javascript. Can anyone point me in the right direction?

(Pseudocode example of what I would like to insert into my VB)

If javascript popup exists equals true then
if javascript popup.button.value equals "OK" then
javascript.popup.button.Click
end if
end if

Thanks in advance everybody!

- Tn

Reply With Quote
  #2  
Old February 4th, 2004, 06:25 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
I may be way off-base here, but when connecting to someones webpage using the control, don't you feed their content into a variable first? If so, you should be able to strip out the content in the body tag yourself.

Reply With Quote
  #3  
Old February 4th, 2004, 07:10 PM
tngaijin tngaijin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 16 tngaijin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by stumpy
I may be way off-base here, but when connecting to someones webpage using the control, don't you feed their content into a variable first? If so, you should be able to strip out the content in the body tag yourself.

Indeed you do. In my case the code looks like:

Dim objDocument as htmldocument

Me.acxWebBrowser.Navigate "The string URL of the desired page"

set objdocument = me.acxwebbrowser.document


From there I can infact get a handle onto all of the outerhtml text (ie the whole html document) and then parse through it and find script tags and the text of the functions within. There is even an HTMLScriptElement held within the Document object which will do most of this for you.

That being said, I can assure you that I have done all of that and have been fiddling with the methods provided in said objects for quite some time. I still have not been able to successfully create a script object (or any other object for that matter) that can access a popup alert window that was fired from a javascript function. Honestly I can't even get my automated browser to detect when an alert box has appeared.

Someone from outside the forum has suggested I try an HTMLwindow2 object as well but I have not been able to make anything work yet.

Hope that helps someone as I need some help myself!

Thanks!

-Tn

Reply With Quote
  #4  
Old February 5th, 2004, 02:51 PM
tngaijin tngaijin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 16 tngaijin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
No other thoughts? I have yet to find an answer for this anywhere on the net. There muct be one though as IE is able to pass javascript scripts to a scripting engine and have them meddle with the DOM. Anyone?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > ActiveX Webbrowser control vs Javascript


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 12 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek