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

Microsoft.JScript

P: n/a
Hi there,

as I need to share a .NET context with a JavaScript context and I can't
re-write Rhino in C# ;-) I'trying to understand something about the
Microsoft.JScript namespace, but - really - I'm getting in *deep*
troubles: the documentation is not-so-well written (missing examples,
snippets, references, details and so on) so: can anyone:
1) Explain in 12-words ;-) *what* is Microsoft.JScript and *how* can I
use its classes;
2) link me to a tutorial or any other resource ("for dummies", of course);-)

Thanks in advance!

Cheers,
Giulio - Italia

--
OnAir: Pain of Salvation - Spitfall
Feb 6 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
JScript is Microsoft's "server-side" .NET, strongly typed implementation of
Javascript. It is fully .NET CLR compliant. Not sure what you mean about the
sharing of contexts, if your "Javascript context" means "client script" then
this won't do it - it doesn't run like interpreted Javascript in the browser.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Giulio Petrucci" wrote:
Hi there,

as I need to share a .NET context with a JavaScript context and I can't
re-write Rhino in C# ;-) I'trying to understand something about the
Microsoft.JScript namespace, but - really - I'm getting in *deep*
troubles: the documentation is not-so-well written (missing examples,
snippets, references, details and so on) so: can anyone:
1) Explain in 12-words ;-) *what* is Microsoft.JScript and *how* can I
use its classes;
2) link me to a tutorial or any other resource ("for dummies", of course);-)

Thanks in advance!

Cheers,
Giulio - Italia

--
OnAir: Pain of Salvation - Spitfall
Feb 6 '07 #2

P: n/a
"Giulio Petrucci" <gi*************@thisisafakedomain.comwrote in message
news:O$**************@TK2MSFTNGP03.phx.gbl...
Hi there,

as I need to share a .NET context with a JavaScript context and I can't re-write Rhino in
C# ;-) I'trying to understand something about the Microsoft.JScript namespace, but -
really - I'm getting in *deep* troubles: the documentation is not-so-well written (missing
examples, snippets, references, details and so on) so: can anyone:
1) Explain in 12-words ;-) *what* is Microsoft.JScript and *how* can I use its classes;
2) link me to a tutorial or any other resource ("for dummies", of course);-)

Thanks in advance!

Cheers,
Giulio - Italia

--
OnAir: Pain of Salvation - Spitfall

You might get better answers when posting to: microsoft.public.dotnet.languages.Jscript

Willy.

Feb 6 '07 #3

P: n/a
Hi Willy,

Willy Denoyette [MVP] ha scritto:
You might get better answers when posting to:
microsoft.public.dotnet.languages.Jscript
I'll try.
Anyway: I don't need informations about the JScript language, but about
the classes of the Microsoft.JScript namespace.

Thanks for your suggestion,
Giulio
Feb 6 '07 #4

P: n/a
"Giulio Petrucci" <gi*************@thisisafakedomain.comwrote in message
news:ux**************@TK2MSFTNGP04.phx.gbl...
Anyway: I don't need informations about the JScript language, but about
the classes of the Microsoft.JScript namespace.
Google is your friend:
http://www.google.co.uk/search?hl=en...amespace&meta=

The first match returned looks pretty useful, as it's entitled
"Microsoft.JScript Namespace" and describes every class in it... :-)
Feb 6 '07 #5

P: n/a
Mark Rae ha scritto:
Google is your friend:
yep, anyway as I told before, the msdn documentation about this
namespace is quite unuseful.

Bye,
Giulio
Feb 6 '07 #6

P: n/a
Hi Peter,

Peter Bromberg [C# MVP] ha scritto:
Not sure what you mean about the
sharing of contexts, if your "Javascript context" means "client script" then
this won't do it - it doesn't run like interpreted Javascript in the browser.
I don't need to use any browser, don't worry ;-)
Let me explain better the scenario I'm currently dealing with. I have an
application with it's own context (implemented with a class called
ApplicationContext, could it be a good solution?) with some variables
and so on. Let's say[1]:

int foo = 3;
string bar = "this_is_bar";

Within this context there are some conditions defined by the user with
some javascript code: when they're executed the application can use them
as logical seitches (i.e. if such a condition is true, then do
something, else do something else). Moreover, user can define some
JavaScript functions that can be called within those conditions. Let's
suppose I have this function:

function f(a)
{
return a*a;
}

and a condition using this function, let's say:

function condition_1()
{
if (bar=="this_is_bar")
return f(foo);
else return foo;
}

as you could see in these scripts the user has defined some "logical"
using elements (foo,bar) belonging to the application context; moreover
there are cross-references between these scripts. If I use a dynamic
JScript compilation (and I won't talk about the loss of performance that
it brings). So I should implement something to make this JavaScript
context "talk" with my .NET application, and allow cross-reference
across the same JavaScript context.
Any suggestion?

Thanks in advance,
Giulio

--
[1] : actually I mapped all the variables to instances of a Variable
class I defined, that allow application to treat variables as they're
dynamic (or a sort of). So I actually have:

Variable foo = new Variable(3);
Variable bar = new Variable("this_is_bar");

In this way I can create assembly compiling dinamically the js code,
adding functions (invoked by reflection) taking objects as parameter
just to update the variables values as those Variable objects are
changed. In this way, i.e. compiling each js function into an assembly I
cannot use cross-referece, so I actually have *no* js context. So i
thought to compile all the functions within the same assembly. It's
functional but not so elegant. Moreover the dynamic compilation takes a
looooooooooooooooooong time ;-)
Feb 6 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.