Results 1 to 11 of 11

Thread: [RESOLVED] How to Call a JavaScript function From Visual Basic 6 WITH wanted parameters

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2011
    Posts
    15

    Resolved [RESOLVED] How to Call a JavaScript function From Visual Basic 6 WITH wanted parameters

    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
    Last edited by Verzulsan; May 24th, 2011 at 06:42 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width