473,788 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert Javascript to VBscript

54 New Member
Hi,

i have a javascript code. I want to convert into VBscript.

pls
help me

Javascript Code:

Expand|Select|Wrap|Line Numbers
  1. <!-- TWO STEPS TO INSTALL VIRGENERE ENCRYPTION:
  2.  
  3.   1.  Copy the coding into the HEAD of your HTML document
  4.   2.  Add the last code into the BODY of your HTML document  -->
  5.  
  6. <!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
  7.  
  8. <HEAD>
  9.  
  10. <SCRIPT LANGUAGE="JavaScript">
  11. <!-- Original:  Francisco Ryan Tolmasky (iopossum@mailcity.com) -->
  12. <!-- Web Site:  http://iopossum.tripod.com -->
  13.  
  14. <!-- This script and many more are available free online at -->
  15. <!-- The JavaScript Source!! JavaScript Source: Free JavaScripts, Tutorials, Example Code, Reference, Resources, and Help -->
  16.  
  17. <!-- Begin
  18. var TID = 0;
  19. var longer = 0;
  20. var thirdwrite = "";
  21. var alphabet = new Array("0@","1#","2$","3%","4^","5&","6*","7 = ","8-","9+","Aa","Bb","Cc","Dd","Ee","Ff","Gg","Hh","Ii","Jj","Kk","Ll","Mm","Nn","Oo","Pp","Qq","Rr","Ss","Tt","Uu","Vv","Ww","Xx","Yy","Zz");
  22. function preTime(coco, uinput, question) {
  23. longer = coco.length - 1;
  24. placement = 0;
  25. ref = 0 ;
  26. secondWrite = "";
  27. firstWrite = "";
  28. thirdWrite = "";
  29. code1(coco, uinput, longer, question);
  30. }
  31. function findshift(letter) {
  32. for (i = 0; i < 36; i++) {
  33. if ((alphabet[i].substring(0,1) == letter) || (alphabet[i].substring(1,2) == letter)) {
  34. if (alphabet[i].substring(0,1) == letter) {
  35. x = 0;
  36. }
  37. if (alphabet[i].substring(1,2) == letter) {
  38. x = 1;
  39. }
  40. return i;
  41.       }
  42.    }
  43. }
  44. function check(letter) {
  45. bill = "no";
  46. for (i = 0; i < 36; i++) {
  47. if ((alphabet[i].substring(0,1) == letter) || (alphabet[i].substring(1,2) == letter)) {
  48. bill = "yes";
  49.    }
  50. }
  51. if (bill == "yes") {
  52. return true;
  53. }
  54. else {
  55. return false;
  56.    }
  57. }
  58. function fixoffset(takin) {
  59. if (takin > 35) {
  60. return (takin - 36);
  61. }
  62. else {
  63. return takin;
  64.    }
  65. }
  66. function code1(inval1,inval2,inval3,sage) {
  67. if (check(inval2.charAt(placement))) {
  68. if (check(inval1.charAt(ref))) {
  69. if (sage == 0) { 
  70. shift = findshift(inval1.charAt(ref));
  71. }
  72. if (sage == 1) { 
  73. shift = 36 - findshift(inval1.charAt(ref));
  74.    }
  75. }
  76. else {
  77. shift = 0;
  78. }
  79. orig = findshift(inval2.charAt(placement));
  80. firstWrite = firstWrite+alphabet[fixoffset(orig+shift)].charAt(x);
  81. }
  82. else {
  83. firstWrite = firstWrite+inval2.charAt(placement);
  84. }
  85. secondWrite = inval2.substring(placement+1,inval2.length+1);
  86. thirdWrite = firstWrite+secondWrite;
  87. document.inputo.written.value = thirdWrite;
  88. placement++;
  89. if (ref == inval3) {
  90. ref = 0
  91. }
  92. else {
  93. ref++;
  94. }
  95. if (placement == (inval2.length)) {
  96. window.clearTimeout(TID);
  97. return false;
  98. }
  99. one = inval1;
  100. two = inval2;
  101. three = inval3;
  102. goer = sage;
  103. TID = window.setTimeout("code1(one, two, three, goer)", 0);
  104. }
  105. //  End -->
  106. </script>
  107. </HEAD>
  108.  
  109. <!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
  110.  
  111. <BODY>
  112.  
  113. <center>
  114. <form name="inputo">
  115. <textarea name=written rows=12 cols=40>Type message to encode here</textarea>
  116. <br>
  117. Code Phrase:<input type=text name=codeWord value="code phrase here">
  118. <input type=button value="Encode" onClick="preTime(codeWord.value,written.value, 0);">
  119. <input type=button value="Decode" onClick="preTime(codeWord.value,written.value, 1);">
  120. </form>
  121. </center>
  122.  
  123. <p><center>
  124. <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
  125. by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
  126. </center><p>
  127.  
Thanks,
Murugavel
Jan 17 '09 #1
2 7766
gits
5,390 Recognized Expert Moderator Expert
what help do you need exactly? just have a look at the code you posted and rewrite it in vb. in case you have specific problems with the JavaScpript code, then post back here so that we could explain the JavaScript-statements that you want to have explained ... but certainly noone will just rewrite that script for you.

kind regards
Jan 17 '09 #2
acoder
16,027 Recognized Expert Moderator MVP
Hmm... why would you even want to convert from JavaScript to VBScript? JavaScript works in more or less all browsers while VBscript is limited to a single browser. Now I could understand if the request was the other way round, i.e. from VBScript to JavaScript.
Jan 18 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
6827
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't understand the differences between ASP JavaScript and ASP VBScript?? Because JavaScript is client-side technology, and ASP is server side technology. I think VBScript is used to implement ASP pages.
5
14289
by: Bill | last post by:
I need to convert a variable, nNum, into a two-character string. nNum is always less than 100. If nNum is 0, the string needs to be "00", if it's 1, it needs to be "01", if it's 34, it needs to be "34". What's the best way to do this? Thanks,
2
8917
by: davidgordon | last post by:
Hi, I have some pages with this VBScript code, which obviously does not work in Firefox. How can I convert this to Javascript in order for my web page to work in Firefox ? It basically fills a drop down with a list of dates that a user can select. Appreciate any help you can offer ----------------------
1
8265
by: darcykahle | last post by:
Is there any way of converting an existing access form into html format? The form in question has built-in visual-basic code, which gets commented out when you use the "save as" method, instead of incorporated into the functionality of the html. We are considering putting these html versions onto an IIS server for internal use, but we do not want to re-write all of the code for use in the html version.
10
11156
by: thinktwice | last post by:
in my script file , i need call a method of a atl com module(implemented in vc++), which returan an safearray. i don't know how to convert it into array in jscript. i have tried serveral ways to get each item but failed at last. could anyone help me?
11
13405
by: Doug van Vianen | last post by:
Hi, I often like to include some JavaScript coding in my web pages to make them more interesting. Unfortunately, even when this coding is as simple as a check to see what the display width is in pixels so that pictures on the page can be adjusted to better fit the display, Internet Explorer detects the coding and blocks it. Of course the user can click on the message displayed above the web page to allow "the active component" but many...
3
63108
by: rishabhshrivastava | last post by:
Hello All, How can I convert a value to Double in JavaScript??? In vbscript i believe its done as cDbl(Value) I tried lots of way but getting a value of "NaN". Any suggestions/ideas will be truely appreciated.
28
5932
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I convert a Number into a String with exactly 2 decimal places? ----------------------------------------------------------------------- When formatting money for example, to format 6.57634 to 6.58, 6.5 to 6.50, and 6 to 6.00? Rounding of x.xx5 is uncertain, as such numbers are not represented exactly. See section 4.7 for Rounding issues.
1
2535
by: sathyan8294 | last post by:
what is websites for convert javascript to vbscript?
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5399
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.