PD EDIT: My version of VB is Visual Basic 6.0 from Excel.
Hello, this is not like last question where I did not care with or without parameters:
How to Call a JavaScript function From Visual Basic 6 with or without parameters
This time I do need to send the parameters I want.
In the web page I have many of this two lines with unic ID in this cases 1234,777 (just examples):
PHP Code:
<a onmouseout="hideBoxInfo();" onmouseover="BigBoxInfo(1234);" href="DialogPageInfo.php?Box_id=57485">
<a onmouseout="hideBoxInfo();" onmouseover="BigBoxInfo(777);" href="DialogPageInfo.php?Box_id=42837">
I can call the onmouseover with:
Code:
k = 0
For Each ele In IE.Document.GetElementsByTagName("a")
If ele.onmouseout = "hideBoxInfo();" <> "" Then
k = k + 1
If k >= 14 Then
Cells(k, 1) = ele.onmouseover
Call ele.fireevent("onmouseover")
End If
End If
Next
In the Innertext the function looks something like this:
Code:
function BigBoxInfo(id)
{
....SourceCode blabla....
}
======================================================
It would be great if I could just call function BigBoxInfo(ID=Any ID I want), instead of having to search for the page where the HTML is compiled with the tags <a onmouseover="BigBoxInfo(ID I want);"> so I am able to fireevent.
I have tried firebug to change the ID, and onmouse over it loads the information even if I am not on the page where that ID form is showing.
I have also search for information where some people says its imposible to call a javascript function from VB6 and instead, they use:
RegisterClientScriptBlock
RegisterStartupScript
I can swear I have been nearly 4 hours trying to find some code that works with Visual Basic 6 but so far no luck.
It would be great if I could just add lines and lines with the IDs I want and the only fire the events
<a onmouseover="BigBoxInfo(1);">
<a onmouseover="BigBoxInfo(2);">
<a onmouseover="BigBoxInfo(....);">
<a onmouseover="BigBoxInfo(9999);">
<a onmouseover="BigBoxInfo(N);">
, or even better, just directly call the function witout the HTML need.
Thanks and sorry for the big post