Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hai,

 

I've a Windows Forms with a Button and AxWebBrowser, and i've loaded AxWebBrowser with a dynamic HTML page (with a javascript function). My problem is, How do i invoke javascript by clicking on the button which is available on Windows forms. (i've tried some thing but no joy...)

 

Sample HTML Code

---------------------

<html>

<head>

<script language=javascript>

function somefunction() {

alert ("Function sucessfully executed...");

}

</script>

</head>

<body>

bla....bla...

</body>

</html>

 

in VB.NET

------------

AxWebBrowser.Document.ParentWindow.execScript("somefunction()", "JScript")

 

Thanks in advance

Ajai Kumar .R

  • 2 years later...
Posted

do i can set my string value to some javascript code and run it by this command?

like as:

strnig mycode="alert('i am a string')";

brWeb.Navigate("javascript:"+mycode)

[ once4ever ]
  • 5 months later...
Posted

how to send a javascript objet to a function

 

Hi,

 

what if the function to call, has a parameter ((this) like this:

 

onclick="Myfunction(this);"

 

how can i call this from vb.net? im using the Navigate method, but cannot send the object since it doesnt have an id or name property...

 

TKS!

Posted
Instead of passing "this" you simply reference the object in some way with document.getElementById(...) or something similar like document.window' date=' etc.[/quote']

 

being tr a table row with a click funtion, that receives an object this, and tr, not having an id or name property, how can i pass the obejct to the js function, using something like the following line of code in vb.net?

 

WebBrowser.Navigate("javascript:MyFunction(" & tr & '');")

 

TKS!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...