By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,960 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,960 IT Pros & Developers. It's quick & easy.

Use JavaScript in VB Application

P: n/a
Hi All.

I have a function with javascript is used in my ASP web Page.Now i
want to write an application with VB6 same as my asp page and i need
to use that javascript function.Can i insert this function in my VB6
app.?

Thnaks.

Behzad
Jul 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
In article <ae**************************@posting.google.com >, Bsedigh_79
@yahoo.com enlightened us with...
I have a function with javascript is used in my ASP web Page.Now i
want to write an application with VB6 same as my asp page and i need
to use that javascript function.Can i insert this function in my VB6
app.?

Thnaks.


Not as far as I know.
-------------------------------------------------
~kaeli~
Press any key to continue or any other key to quit.
Who is General Failure and why is he reading
my hard disk?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
-------------------------------------------------
Jul 20 '05 #2

P: n/a
Behzad,

I don't think so, straight VB does not (can't) interpret JS code.

ASP uses VB syntax and constructs but it only integrates with JavaScript
because it is a server-side scripting language. In most situations, the Web
server interprets the ASP code and the client part (browser) interprets the
JS code.

Assuming your JS code is not about HTML operations, your best option would
probably be to re-code the routine's functionality entirely in VB. People
do it all the time. ;-)

--
HTH,
DWilliams
"Behzad" <Bs********@yahoo.com> wrote in message
news:ae**************************@posting.google.c om...
Hi All.

I have a function with javascript is used in my ASP web Page.Now i
want to write an application with VB6 same as my asp page and i need
to use that javascript function.Can i insert this function in my VB6
app.?

Thnaks.

Behzad

Jul 20 '05 #3

P: n/a
On Wed, 3 Sep 2003 08:15:38 -0500, kaeli
<in********************@NOSPAMatt.net> wrote:
In article <ae**************************@posting.google.com >, Bsedigh_79
@yahoo.com enlightened us with...
I have a function with javascript is used in my ASP web Page.Now i
want to write an application with VB6 same as my asp page and i need
to use that javascript function.Can i insert this function in my VB6
app.?

Thnaks.


Not as far as I know.


I suspect it would be more work than it would be worth, but you could
try hosting the windows script engine. Look on MSDN for details.
http://msdn.microsoft.com/library/en...ml/engines.asp

Regards,
Steve
Jul 20 '05 #4

P: n/a
Hi,

DWilliams wrote:
Behzad,

I don't think so, straight VB does not (can't) interpret JS code.

ASP uses VB syntax and constructs but it only integrates with JavaScript
because it is a server-side scripting language. In most situations, the Web
server interprets the ASP code and the client part (browser) interprets the
JS code.
Wow, what a mix of concepts here.

ASP doesn't use VB syntax at all.

ASP is a platform, it exposes a set of libraries and objects allowing
accessing OS functionalities. It happens to support two languages "out
of the box", which are VBScript and JScript (the IE implementation of
JavaScript). ASP as such doesn't has a syntax. You can use exactly the
same objects in VBScript, with the VB syntax, and in JScript, with the
JavaScript syntax.

You are also wrong when you state that the client part interpretes the
JavaScript code. The client interpretes the client-side code, and the
server interpretes the server-side code. The server-side code can be
pretty much anything, depending on the server type, the server OS, the
webserver type, etc... it can be Perl, PHP, Java (JSP or servlets),
JavaScript, JScript, VBScript C/C++, and so many others that's it silly
to want to list them. On the client, the most widely used language is
JavaScript, but some browsers (the IE line) can also interprete and run
VBScript code.

Don't confuse the platform and the language. A language doesn't say
anythign about the platform it runs on, and will run exactly as well as
long as it is supported.
Assuming your JS code is not about HTML operations, your best option would
probably be to re-code the routine's functionality entirely in VB. People
do it all the time. ;-)

--
HTH,
DWilliams


I agree with others saying that it's probably more work than it's worth
trying to simply reuse the function as-is.

Note that if you make the step to .NET (a loooot better than old VB6),
you have the possibility to use JScript.NET as a programming language
(still another platform, and quite another language too), but it is not
said that your function will run as-is on it. It also depends what
objects from the API you're using, of course.

HTH,

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #5

P: n/a
"Laurent Bugnion, GalaSoft" <galasoft-LB@bluewin_NO_SPAM.ch> wrote in
news:3f**********@news.bluewin.ch:
accessing OS functionalities. It happens to support two languages "out
of the box", which are VBScript and JScript (the IE implementation of
JavaScript). ASP as such doesn't has a syntax. You can use exactly the
same objects in VBScript, with the VB syntax, and in JScript, with the
JavaScript syntax.


If you really want to strip it down to its essentials I suppose you could
say ASP is just a multithreaded runtime environment for WSH.
Jul 20 '05 #6

P: n/a
Laurent,

Thanks for that fine lesson, but I don't personally need it.

The intent here was to clarify for the poster about "typical" uses of how
the ASP and the JS are interpreted differently, in the environment that HE
implied. To me, the issue was about being able to "reuse" their JS code in
VB6, not to elaborate on all the various language and platform technologies.

--
HTH,
DWilliams
"Laurent Bugnion, GalaSoft" <galasoft-LB@bluewin_NO_SPAM.ch> wrote in
message news:3f**********@news.bluewin.ch...
Hi,

DWilliams wrote:
Behzad,

I don't think so, straight VB does not (can't) interpret JS code.

ASP uses VB syntax and constructs but it only integrates with JavaScript
because it is a server-side scripting language. In most situations, the Web server interprets the ASP code and the client part (browser) interprets the JS code.


Wow, what a mix of concepts here.

ASP doesn't use VB syntax at all.

ASP is a platform, it exposes a set of libraries and objects allowing
accessing OS functionalities. It happens to support two languages "out
of the box", which are VBScript and JScript (the IE implementation of
JavaScript). ASP as such doesn't has a syntax. You can use exactly the
same objects in VBScript, with the VB syntax, and in JScript, with the
JavaScript syntax.

You are also wrong when you state that the client part interpretes the
JavaScript code. The client interpretes the client-side code, and the
server interpretes the server-side code. The server-side code can be
pretty much anything, depending on the server type, the server OS, the
webserver type, etc... it can be Perl, PHP, Java (JSP or servlets),
JavaScript, JScript, VBScript C/C++, and so many others that's it silly
to want to list them. On the client, the most widely used language is
JavaScript, but some browsers (the IE line) can also interprete and run
VBScript code.

Don't confuse the platform and the language. A language doesn't say
anythign about the platform it runs on, and will run exactly as well as
long as it is supported.
Assuming your JS code is not about HTML operations, your best option would probably be to re-code the routine's functionality entirely in VB. People do it all the time. ;-)

--
HTH,
DWilliams


I agree with others saying that it's probably more work than it's worth
trying to simply reuse the function as-is.

Note that if you make the step to .NET (a loooot better than old VB6),
you have the possibility to use JScript.NET as a programming language
(still another platform, and quite another language too), but it is not
said that your function will run as-is on it. It also depends what
objects from the API you're using, of course.

HTH,

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch


Jul 20 '05 #7

P: n/a
Hi,

DWilliams wrote:
Laurent,

Thanks for that fine lesson, but I don't personally need it.

The intent here was to clarify for the poster about "typical" uses of how
the ASP and the JS are interpreted differently, in the environment that HE
implied. To me, the issue was about being able to "reuse" their JS code in
VB6, not to elaborate on all the various language and platform technologies.


I understand your intent, but it's wrong to state that ASP uses VB
syntax. I stand by that ;-)

Sorry if I sounded like I was lecturing you. There are all kind of
audience in this newsgroup, it's sometimes hard to know who you talk to
and what their level of knowledge.

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #8

P: n/a
Laurent,
I understand your intent, but it's wrong to state that ASP uses VB syntax. I stand by that ;-)<<

Perhaps that is technically wrong, but not wholly inaccurate in the
context of the poster's message and what he, in my opinion, would have
best understood. He obviously saw a correlation between ASP and VB6 or
he would not have been thinking about converting the application.

Which primary language, syntactically or otherwise, would you have
guessed that their ASP application was "oriented" on? I think it would
not be JScript.
Sorry if I sounded like I was lecturing you. There are all kind of
audience in this newsgroup, it's sometimes hard to know who you talk to
and what their level of knowledge<<

No harm done, this is the nature of the newsgroups. If you participate,
you must be prepared to take some lumps. ;-)

And I totally agree with you on the difficulty in understanding
someone's technical knowledge. This is why I try to make references in
the simplest terms possible if it is a subject/issue I am familiar with.

HTH,
DWilliams
Laurent Bugnion, GalaSoft wrote: Hi,

DWilliams wrote:
Laurent,

Thanks for that fine lesson, but I don't personally need it.

The intent here was to clarify for the poster about "typical" uses of how
the ASP and the JS are interpreted differently, in the environment
that HE
implied. To me, the issue was about being able to "reuse" their JS
code in
VB6, not to elaborate on all the various language and platform
technologies.


I understand your intent, but it's wrong to state that ASP uses VB
syntax. I stand by that ;-)

Sorry if I sounded like I was lecturing you. There are all kind of
audience in this newsgroup, it's sometimes hard to know who you talk to
and what their level of knowledge.

Laurent


Jul 20 '05 #9

P: n/a
On Thu, 04 Sep 2003 15:46:53 GMT, DWilliams
<dw**@nojunk.earthlink.net> wrote:
Which primary language, syntactically or otherwise, would you have
guessed that their ASP application was "oriented" on? I think it would
not be JScript.


Previously, some time ago now, the Microsoft Script manager at the
time, suggested around 40% of ASP work was in JScript. With the
arrival of ASP.NET I think we can conclude even less is now in VB
syntax.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.