473,667 Members | 2,577 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

axWebBrower with on-the-fly content and a JavaScript onclick funti

How do I get a web-browser loaded with on-the-fly content and a JavaScript
onclick popup function to work?

I've embedded an axWebBrowser in my (vb.net) application. The browser
starts with about:blank, and then I set AxWebBrowser1.D ocument.Body.in nerHTML
to the desired HTML. The HTML contains a link (which works fine) and a
Javascript command to put up a popup window. (The popup will show more
on-the-fly content.)

The HTML and popup works great when I put it into a file, but I get a "A
Runtime Error has occured. Do you wish to Debug? Line 9, Error: Object
required." The HTML works fine if it's put into a file first, and then I
load it into the embedded browser as a file URL. Starting with the
about:blank and and the javascript onclick seem to be the problem.

I've reduced the code to just a single empty function.. it seems to be a
problem with the onclick that gets confused because I've started with a blank
URL.

Sample code is below. The form has one web browser, one button (to load the
content into the browser), one text box for the created HTML, and one text
box to show the browser tatus.

How do I load content into an embedded browser (on the fly) , so I can load
new content into a popup window (not a URL)? Any ideas?

-- Malcolm

Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
AxWebBrowser1.N avigate2("about :blank")
End Sub

Public Sub loadwebcontent( )
Dim myPopupCode As String
myPopupCode = "<script language=""java script""
type=""text/javascript"">" & vbNewLine & _
"function popup() { }" & vbNewLine & "</script>" & vbNewLine

' href="#" doesn't work either..
Dim content As String = "<a href="""" onclick=""popup (); return
false;"">popup me</a>" & vbNewLine
content = content & "<p><a href=""http://www.google.com" ">google
me</a>" & vbNewLine
Dim myHTML As String = "<html>" & vbNewLine & _
"<head>" & vbNewLine & _
" <title> Popup Listing</title>" & vbNewLine & _
myPopupCode & vbNewLine & _
"</head>" & vbNewLine & _
"<body>" & vbNewLine & _
content & vbNewLine & _
"</body>" & vbNewLine & _
"</html>" & vbNewLine

TextBox2.Text = myHTML

' Found this jewel at
http://www.experts-exchange.com/Prog..._21067341.html
AxWebBrowser1.D ocument.Body.in nerHTML = myHTML

End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
loadwebcontent( )
End Sub

Private Sub AxWebBrowser1_E nter(ByVal sender As System.Object, ByVal e
As AxSHDocVw.DWebB rowserEvents2_S tatusTextChange Event) Handles
AxWebBrowser1.S tatusTextChange
TextBox1.Text = e.text
End Sub
End Class

Jul 21 '05 #1
0 1584

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

Similar topics

6
3506
by: Chris Krasnichuk | last post by:
Hello every one, Does anyone know how to make php work on your computer? please reply I need help Chris
20
11657
by: Chris Krasnichuk | last post by:
hello, Does anyone know how I make php work on "my" computer? I made a mistake in my last post so I fixed it here. Chris
0
2191
by: Aldo Polli | last post by:
Hi, I have this error when I start apache2 with php4 Syntax error on line 233 of /mypath/apache2/conf/httpd.conf: Cannot load /mypath/apache2/modules/libphp4.so into server: dynamic linker: /mypath/apache2/bin/httpd: relocation error: symbol not found: ap_pass_brigade; referenced from: /mypath/apache2/modules/libphp4.so I compile apache 2.0.46 with
4
12429
by: Frank | last post by:
Whats best : register_globals ON ? OR register_globals OFF ? I currently use: $_POST
2
3702
by: Patricia | last post by:
I am a new Oracle user. I am trying to install Oracle 9i Personal Edition on Windows ME; however, I am getting the following error during the installation: Oracle Database Configuration Assistant failed during install. Error message: java.lang.NoClassDefFoundError: com/inprise/vbroker/CORBA/ObjectException in thread "main" at oracle.sysman.assistants.dbca.backend.Host.<init>(Host.java:437) at...
57
25505
by: Bing Wu | last post by:
Hi all, I am running a database containing large datasets: frames: 20 thousand rows, coordinates: 170 million row. The database has been implemented with: IBM DB2 v8.1
1
1388
by: gndzkdr | last post by:
hi all, i m new on Sql and i have a project related to C# and Sql. i have to do a project which must work on LAN, and there must be only one database file on main computer(Server Computer) and other computers(client computers) must connect database on main computer. i m preparing my project on my personal computer(it is called MYCOMP) and doing connection with wizard. then it doesnt work on other
8
7600
by: PhongPham | last post by:
Hello, Info relate: OS : uclinux Platform : unix version 2.4.22 (or 2.4.26) Chip on board : ARM7 I want to get a python package on network to "make" in linux (Fedora core 1 or anything if it maybe done) and run python on board with above info .After I made package 2.2.3 and 2.5.2 of Python, I tried run on board such: ./python <script> with <script> is a script file and get error : BINFMT_FLAT: bad magic/rev (0x1010100, need...
19
4213
by: pmw | last post by:
Hi I've got a problem with my current application. I currently use Windows Vista with Visual Studio Express 2008. If I compile the application on Vista, it works fine on Vista, but it doesn't work on XP. If I compile it on XP (with the same source code ), it runs without any problems. The thing is: I only have a virtual machine to test my software on XP, but I can't develop on it.
16
2888
by: tvnaidu | last post by:
I have these two ON and OFF buttons html code below, based on condition I am displaying status on screen(I have mutliple lines for each LED), my row shifting when some displaying ON and some displaying OFF, because ON button is smaller than OFF (ON is 2 character and OFF is 3 character), Is there anyway I can specify for both should take fixed length?. <input type="button" value="ON " style="background-color: #00cc00; color: #ffffff;" /> ...
0
8365
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8883
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8788
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8563
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8646
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7390
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4200
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.