涵盖JavaScript到vbscript的帮助! [英] Coverting javascript to vbscript help!

查看:118
本文介绍了涵盖JavaScript到vbscript的帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,有一个包含10个单词的文本框.我试图在名为ta_val的字符串中找到多少个单词.我已经做过javascript,但是在vbscript中需要帮助.

So there is a textbox with 10 words in it. I am trying to find how many words in the string named ta_val. I already did the javascript but need help in vbscript.

ta_val=document.tb.ta.value;
len_ta=ta_val.length;





var sArray = ta_val.split("");
var sLength = sArray.length;
a.innerHTML = sLength;





我尝试了一下,但没有用.





I tried this and it did not work.

dim sArray = split(ta_val,"")
dim sLength = len("sArray")
a.innerHTML = sLength



是否有将javascript转换为vbscript的地方?像程序一样?



Is there some place to convert javascript to vbscript? Like a program?

推荐答案

为什么要这样做? Javascript是一种标准语言,VBScript是专有的.

查看有关以下主题的ECMA标准:
http://en.wikipedia.org/wiki/ECMAScript [ http://en.wikipedia.org/wiki/JavaScript [ http://en.wikipedia.org/wiki/VBScript [ http://stackoverflow.com/questions/569380/how-can-i- convert-javascript-to-vbscript [ ^ ]:

您可以将VB转换为JS,但可以将JS转换为VB ...那简直是疯狂的话题."
如果需要,可以在Google搜索中进行搜索...

—SA
Why would you do this? Javascript is a standard language, VBScript is proprietary.

Look at the ECMA standards on the topic:
http://en.wikipedia.org/wiki/ECMAScript[^].

This is what Javascript is — an implementation of the ECMAScript:
http://en.wikipedia.org/wiki/JavaScript[^].

This is what VBScript is:
http://en.wikipedia.org/wiki/VBScript[^].

All you can do with VBScript you can do with Javascript, not the other way around.
If you need to preserve you work and make it compatible, forget VBScript and use Javascript in all cases.

Yes, I know I don''t answer your question. You don''t need an answer, you need help.



You will take less time in just learning VBScript than searching for the tool.
By reasons I explained, there are translators from VBScript to Javascript, but I never heard of the opposite.

See:
http://stackoverflow.com/questions/569380/how-can-i-convert-javascript-to-vbscript[^]:

"You can convert VB to JS but JS to VB… that''s just crazy talk."
Do the Google search if you want…

—SA


这篇关于涵盖JavaScript到vbscript的帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆