Web Analytics Made Easy -
StatCounter ActiveX and JSctipt interaction - CodingForum

Announcement

Collapse
No announcement yet.

ActiveX and JSctipt interaction

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ActiveX and JSctipt interaction

    Please tell me how to get URL of an HTML document from
    within an ActiveX, where the ActiveX is used in a JScript
    which is implemented in the HTML document.

    I use IE and the HTML is like below.

    <script language="JavaScript">
    <!--
    function doit()
    {
    obj = activeXObject("MyActiveX.MyMethod.1");
    obj.TryToGetURL(this);

    ....

    A particle of sample source code of the ActiveX coded
    with ATL or
    any suggestion would be very appresicated.

    Thank you.

  • #2
    Are you asking how to get the classId from a progId?

    If that's the case, you'd have to use WSH to read your registry.
    hmm... ?

    Comment


    • #3
      Thank you

      No. I think my question is a matter related

      to "ActiveX written in C++"
      or
      to "Inside of JScript".


      Thank you for your replay.

      Comment


      • #4
        Download Sarissa from http://sarissa.sourceforge.net/

        Then right after your <BODY> tag, add:
        Code:
        <script language="javascript" src="sarissa.js"></script>
        After that external script tag, add:
        Code:
        <script language="JavaScript">
        
        var url = "http://www.netscape.com/"; // URL of document to fetch
        var document;
        
        var xmlhttp = Sarissa.getXmlHttpRequest();
        xmlhttp.open("GET", url, false);
        xmlhttp.send();
        document = xmlhttp.responseText;
        // Now the document variable contains the contents of the fetched URL.
        
        </script>

        Comment


        • #5
          Re: Thank you

          Originally posted by gordon
          I think my question is a matter related to "ActiveX written in C++"
          This might help:

          Q Is there any way to find out the host address of the caller inside a method?
          hmm... ?

          Comment

          Working...
          X