Stanley83
asked on
VB program accessing a javascript variable
i critically need to know how a visual basic program can retrieve a javascript variable and display it. Please help me. Thanks :)
example of a js file :
function run()
{
i = 0;
document.write('Value : ' + i);
}
////////////////////////// ////////// /
a HTML file
<html>
<head></head>
<body onload="run();">
<!-- this is the part where i want the visual basic program to change the value of i into another value after document.write has done its work -->
</body>
</html>
example of a js file :
function run()
{
i = 0;
document.write('Value : ' + i);
}
//////////////////////////
a HTML file
<html>
<head></head>
<body onload="run();">
<!-- this is the part where i want the visual basic program to change the value of i into another value after document.write has done its work -->
</body>
</html>
Try read the value in a Hidden Field, then vb might able to change it using the webbrowser control.
>>Try read ?
Sorry, it's Try write
Sorry, it's Try write
ASKER
Sorry, i dont get what u mean. But the value captured will still be inside the memory. Thats what puzzled me. How does the VB program knows what value to capture from the memory since the javascript store the hidden value inside the computer. And also the javascript cannot have any file access. I try not to use Jscript as it is too confusing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanx alot it can help a little..but then what im trying to get is to get the ouput to a webpage. not a msgbox. hope to make it looks like a web chatting website which can auto-refresh itself without using DHTML
>>web chatting website ?
Try use the Winsock control
Try use the Winsock control
ASKER
hmm, its ok..thank you anyway. :) Well, i have submitted my project to my lecturer already. So, its kinda late now..haha..anyway, thanx alot for your help. Maybe next time, i will ask at an earlier time..