JavaScript and C#
I was wondering if there would be any demand for a product that allowed you to call managed code from JavaScript. It seems like it should be doable, using a technology like Mirror, and would allow you to rapidly create apps with a rich HTML UI and deploy them over the web. However, you could also argue that .Net CF and WinForms also allow rapid application development, and provide much the same benefit, and with better debugging support. (CF apps don't deploy over the web, but then again, it's not that hard to click on a CAB on a web page.)
So what do you think? Would there be any use for such a technology (beyond "Hey, that's a cool proof-of-concept")?
- Jason Fuller
Comments
Anonymous
December 09, 2005
I think it would be awesome to be able to put exploit code on the web, and have it access C# classes on people's phones via Javascript.
Well, maybe only awesome in the original sense of the term, tied closely to awful.
If you do this, please have a way to control the list of accessible classes foreach bit of Javascript.Anonymous
December 10, 2005
AJAX.NET already allows this
http://ajax.schwarz-interactive.de/csharpsample/default.aspxAnonymous
December 10, 2005
Yes definately. I can think of a number of applications that we are developing that could make really good use of such an implementation.Anonymous
December 12, 2005
Adam, obviously, security would have to be considered.
Chris, Ajax.Net is for talking to a server, not managed code running locally on the device. Also, Ajax.net apparently does not support Windows Mobile.Anonymous
December 12, 2005
I was involved in work at my company a while back that ported JScript to the Compact Framework, to allow Users to write small pieces of logic in a language they already understood. But it wasn't really focused on the UI side of things.Anonymous
December 15, 2005
I'm glad to hear that security must be considered. I think the first consideration should be the attack surface. This change would open an entirely new set of vectors to the device. Any security features you add to it would be narrowing that vector. But the permissioning model on my 2003 device seems pretty simple (which is good, except everything needs permissions).
I'd really like to know that there's a large audience of developers that would make the increase in risk worthwhile.Anonymous
July 24, 2006
question: you mentioned that we can use Mirror to let Jscript call managed code at teh device,
can you be more specific on that? If I have a winodes mobile 5 device and I have a managed code that use camera function , can I call this code using JScript at IE mobile (w/ support of "Mirror")? how?
ThanksAnonymous
July 24, 2006
question: you mentioned that we can use Mirror to let Jscript call managed code at the device,
can you be more specific on that? If I have a winodes mobile 5 device and I have a managed code that use camera function , can I call this code using JScript at IE mobile (w/ support of "Mirror")? how?
ThanksAnonymous
November 23, 2006
So, So, what is the answer? How do you call C# from javascript? I am not talking about connecting to the server, but C# code that have already been installed on the same machine as the browser that runs Javascript.Anonymous
January 03, 2007
what is the answer? How do you call C# from javascript? I am not talking about connecting to the server, but C# code that have already been installed on the same machine as the browser that runs Javascript.Anonymous
February 19, 2007
The comment has been removedAnonymous
November 03, 2007
The comment has been removedAnonymous
June 03, 2008
I was thinking of the possiblity too. It would be nice if it could be done.