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, 03: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, 07:25 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to 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.
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old February 4th, 2004, 08: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, 03: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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT