简体   繁体   中英

Can I use silverlight to replace javascript and JQuery?

I have a webapplication that heavily uses JQuery. I would like to start using silverlight in its place if its possible. Instead of using jquery ajax features and other jquery features I would like to use silverlight. is this possible to do with silverlight?

Different tools. jQuery is best for manipulating the DOM. Silverlight is (ostensibly) best for rich internet apps, not manipulating the 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.

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.

I agree with Jonathon, they are really are two different tools.

Thanks.

Nick

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.

So the answer is Yes. But you would better stick with jQuery.

@Luke101, you can design an whole website using 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.

Given the amount of paranoia out there I think people are a little hesitant to download something when a broswer asks you to.

The environment you'll be working in i don't think will be HTML any longer and you'll be working in 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.

What is the motivation behind moving to 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.

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. Also, does your designer know about Expression or Blend and know how to use it?

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. 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. 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. The danger is that Silverlight can quickly balloon into an application that is difficult to update (though it will guarantee cross browser compatibility). Silveright is entering version 4 and it's still not finished yet, so it's changing rapidly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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