473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Call javascript function from browser control?

I'm using the Browser control to display html that my application generates.
Some times i want a javascript to run when the html gets displayed in the
browser control, and sometimes i dont.

Is there a way to invoke a javascript function from the browser control? or
maybe inject some javascript vis the control's reference to the Document
object? I think i can do it with the Window object, but I have seem to
figout out how to get to the Window object from the browser control or the
Document object.

Any ideas?

Dec 28 '05 #1
1 2342
Think this through. What triggers whether or not JavaScript should run?

If user action, does it cause a server trip or not?
If so, embed the code when you roundtrip the page.
If not, you may want to try to whack at it in the manner you are attempting.

What triggers the action? Time? User Interaction?
Even if you do not have a server trip, a planned user action can be embedded
when the page is delivered to the user.

When you are dealing with a web application, which is what you are dealing
with in the control, try to stick to the model provided rather than whacking
at the code from the container (actual browser or browser control).

The biggest question is this: what are you trying to accomplish (the
problem, not the technology to solve the problem) and why? Answering those
questions will give you a better answer as to what you should do. If you try
to solve technology first, you will likely end up with a wrong answer.

If you are trying to change pages, that can be accomplished by the browser
control itself or in the page. If the page is being clicked, you should
control it in the web app. If you are trying to change the way the contained
application works, you are better to envision the proposed solution and embed
the JavaScript on a server trip that can handle a specific click.

Good luck!

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"john conwell" wrote:
I'm using the Browser control to display html that my application generates.
Some times i want a javascript to run when the html gets displayed in the
browser control, and sometimes i dont.

Is there a way to invoke a javascript function from the browser control? or
maybe inject some javascript vis the control's reference to the Document
object? I think i can do it with the Window object, but I have seem to
figout out how to get to the Window object from the browser control or the
Document object.

Any ideas?

Dec 28 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
3
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: ...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
4
by: Zuel | last post by:
Hi Folks. So I have a small problem. My DoPostBack function is not writen to the HTML page nor are the asp:buttons calling the DoPostBack. My Goal is to create a totaly dynamic web page where...
6
by: den 2005 | last post by:
Hi everybody, Question 1: How do you set the values from server-side to a client-side control or how do you execute a javascript function without a button click event? Question 2: How do you...
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
4
by: verci | last post by:
Hi guys, I'm running asp.net 2.0. Does anyone know how to fire or call a javascript function from inside my (VB.aspx) code without assigning it to a control attribute? thank you
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
29
Frinavale
by: Frinavale | last post by:
I have 2 FireFox (version 2) browser windows opened. One is the child of the other. When the user is finished with the child window, a method in the parent window is called to refresh a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.