Reputation: 19826
I am working on an ASP.NET MVC application and using jQuery.
I understand from various web resources that I should:
Now the problem is that on different views, I need to do different things when DOM is ready. For example lets assume I want to slideUp element with id ID1 on View1 and slideDown element with id ID2 on View2. How can I do this from single js file?
Upvotes: 1
Views: 215
Reputation: 4258
As I see it, I don't think your project / application is going to support that pattern of improving performance. Personally, if you have a lot of view-specific JavaScript going on (do X on View1, Y on View2), I think your view templates are the perfect place for them. I would:
Upvotes: 4