简体   繁体   English

我可以使用silverlight来替换javascript和JQuery吗?

[英]Can I use silverlight to replace javascript and JQuery?

I have a webapplication that heavily uses JQuery. 我有一个大量使用JQuery的web应用程序。 I would like to start using silverlight in its place if its possible. 如果可能的话,我想开始使用silverlight。 Instead of using jquery ajax features and other jquery features I would like to use silverlight. 而不是使用jquery ajax功能和其他jquery功能,我想使用silverlight。 is this possible to do with silverlight? 这可能与silverlight有关吗?

Different tools. 不同的工具。 jQuery is best for manipulating the DOM. jQuery最适合操作DOM。 Silverlight is (ostensibly) best for rich internet apps, not manipulating the DOM. Silverlight(表面上)最适合富Internet应用程序,而不是操纵DOM。 If your web application tries to create a cool UI using JavaScript, Silverlight might be a good fit to replace tons of JavaScript code. 如果您的Web应用程序尝试使用JavaScript创建一个很酷的UI,那么Silverlight可能非常适合替换大量的JavaScript代码。

If you application uses JQuery now replacing it with Silverlight will most likely not only entail redoing your JQuery features but also any HTML, CSS, forms processing and really everything about your application depending on what it does and how it is current designed. 如果你的应用程序使用JQuery现在用Silverlight替换它很可能不仅需要重做你的JQuery功能,还需要重做任何HTML,CSS,表单处理以及关于你的应用程序的所有内容,具体取决于它的功能和当前设计的方式。

I agree with Jonathon, they are really are two different tools. 我同意Jonathon,他们真的是两种不同的工具。

Thanks. 谢谢。

Nick 缺口

nickgs.com nickgs.com

Technically, Yes. 从技术上讲,是的。

But you must understand that you will have to rewrite all your application from the bottom. 但您必须明白,您必须从底部重写所有应用程序。 Microsoft propose the RIA Services as the best practice design to use with Silverlight but with this will make you change all your design and even the Data layer. Microsoft建议将RIA服务作为与Silverlight一起使用的最佳实践设计,但这将使您更改所有设计甚至数据层。

So the answer is Yes. 所以答案是肯定的。 But you would better stick with jQuery. 但你最好坚持使用jQuery。

@Luke101, you can design an whole website using Silverlight no probs. @ Luke101,您可以使用Silverlight no probs设计整个网站。 The question though is what is your target audience? 但问题是你的目标受众是什么?

Silverlight doesn't come shipped with the browsers as yet so a lot of computers don't have it yet and so need to download it. Silverlight目前尚未附带浏览器,因此许多计算机还没有它,因此需要下载它。

Given the amount of paranoia out there I think people are a little hesitant to download something when a broswer asks you to. 考虑到偏执狂的数量,我认为当一个broswer要求你时,人们有点犹豫下载一些东西。

The environment you'll be working in i don't think will be HTML any longer and you'll be working in xaml. 你将要工作的环境我认为不再是HTML了,你将在xaml工作。

Also consider your target browser. 还要考虑目标浏览器。 There are still a lot of people using <gasp> IE6 and i'm not sure if SL will run on it. 仍然有很多人使用<gasp> IE6,我不确定SL是否会在其上运行。

What is the motivation behind moving to SL? 转向SL背后的动机是什么? If it's because it looks cool, don't forget a lot of that comes down to design and if you're not a design person you're likely to make a bigger hash of it than if you were working in HTML. 如果因为它看起来很酷,不要忘记很多归结为设计,如果你不是设计人,你可能会比你在HTML中工作更大。

You may also want to look at how you integrate with a designer. 您可能还想了解如何与设计师集成。 I know MS Expression is designed to make the job easier but it's still an early product. 我知道MS Expression旨在使工作更轻松,但它仍然是早期的产品。 Also, does your designer know about Expression or Blend and know how to use it? 此外,您的设计师是否了解Expression或Blend并知道如何使用它?

What I'm getting at is there is a large learning curve here which equates to someones money and you may not see anything for some time. 我得到的是这里有一个很大的学习曲线,相当于某人的钱,你可能在一段时间内看不到任何东西。

Yes. 是。

Silverlight runs in the browser, jQuery (JavaScript) also runs in the browser. Silverlight在浏览器中运行,jQuery(JavaScript)也在浏览器中运行。 So they can technically replace each other, assuming all the functionality you want in one exists in the other (including support in various browsers). 所以他们可以在技术上互相替换,假设你想要的所有功能都存在于另一个中(包括在各种浏览器中支持)。

Yes. 是。 Silverlight with RIA services can replace a jQuery AJAX site. 具有RIA服务的Silverlight可以取代jQuery AJAX站点。 Depending on the site's features, you may even be able to break up the features of the site into silverlight "widgets" for individual functionality. 根据站点的功能,您甚至可以将站点的功能分解为silverlight“小部件”以实现各个功能。 The danger is that Silverlight can quickly balloon into an application that is difficult to update (though it will guarantee cross browser compatibility). 危险在于Silverlight可以迅速进入难以更新的应用程序(尽管它将保证跨浏览器的兼容性)。 Silveright is entering version 4 and it's still not finished yet, so it's changing rapidly. Silveright正在进入版本4,它还没有完成,所以它正在快速变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM