CALL JavaScript in VBScript

Author Message
u jayakodi

  • Total Posts : 17
  • Scores: 0
  • Reward points : 0
  • Joined: 9/30/2010
  • Status: offline
CALL JavaScript in VBScript Friday, January 07, 2011 12:05 AM (permalink)
0
jayakodiu@yahoo.com
 
CALL JavaScript in VBScript
 
JS has Maths, Array, Date & String as objects having several useful functions not available directly in VBS; a method of creating these objects and using their functions in VBS is shown in the snippet below:
 
<html>
<body>
</body>
<script language=vbs>
set ele=document.body.appendChild(document.createElement("script"))
ele.setAttribute "language","javascript"
ele.text="var vbm,vbar;vbm=Math;vbar=new Array()"
 
'use atan2 of js
msgbox vbm.atan2(1,1)*180/vbm.pi
'create an array and use
vbar.push 42,44,43,45,46,47
msgbox vbar.length
msgbox vbar.toString()
msgbox vbar.valueOf()
msgbox "reversed "+vbar.reverse()
msgbox "sorted " +vbar.sort()
</script>
</html> 
JS has Maths, Array, Date & String as objects having several useful functions not available directly in VBS; a method of creating these objects and using their functions in VBS is shown in the snippet below:
 
<html>
<body></body>
<script language=vbs>
set ele=document.body.appendChild(document.createElement("script"))
ele.setAttribute "language","javascript"
ele.text="var vbm,vbar;vbm=Math;vbar=new Array()"
 
'use atan2 of js
msgbox vbm.atan2(1,1)*180/vbm.pi
'create an array and use
vbar.push 42,44,43,45,46,47
msgbox vbar.length
msgbox vbar.toString()
msgbox vbar.valueOf()
msgbox "reversed "+vbar.reverse()
msgbox "sorted " +vbar.sort()
</script>
</html>
 
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9