SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Under Construction Poop_Shoot's Avatar
    Join Date
    Jul 2003
    Location
    Sacramento, CA
    Posts
    330
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript & VBScript!

    Is it possible to exchange data between Javascript and VBScript! In other words can they communicate!

  2. #2
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think so, unless you applied said data to a document element, and then read it with the other language.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  3. #3
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't think so either, but it just so happens that someone has asked me this question before and I experimented a little. I was surprised - but it does work:
    Code:
    <html>
    <head>
    
    <script type='text/javascript'>
    window.onload = function() {
      entrance_onClick();
    }
    function js() {
      alert("js function called from vbs");
    }
    </script>
    
    <script language="vbscript">
    Sub entrance_onClick
      MsgBox ("vbs sub called from js")
      js()
    End Sub
    </script>
    
    </head>
    <body>
    </body>
    </html>

  4. #4
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Of course, it only works in IE

  5. #5
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The same goes for server-side JScript and VBScript in ASP.

    However, just to pre-empt anyone asking, you cannot call server-side code from client-side code (or vice-versa) without using remote scripting - JSRS being the implementation that I'd recommend.
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!


Bookmarks

Posting Permissions

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