English 中文(简体)
Possible JavaScript framework version conflicts when using site-wide vs local page scripts
原标题:

I assume this would be an issue with any JavaScript framework.

I use MooTools on allot of the pages on my site. On some pages the scripts are 2 years old. When a new page needs MooTools I usually download the latest version to avoid any possible hang-ups with past bugs and to make use of any new features.

This has worked fine as my older pages still work and my new pages have the latest and greatest.

Recently I ve wanted to use MooTools on page elements that are shared on all pages of the site. Like the site header or navigation.

I have not done this yet but I assume that having a site-wide version of MooTools will conflict with existing versions in use on older pages.

I d hate to be committed to one version for the whole site, and only upgrading when I ve tested all the older pages to ensure they didn t break with a new version.

Questions are: What options do I have? What solutions have you guys used that work? Is there a feature that allows for two versions to coexist on the same page?

最佳回答

I would feel like something had gone really badly wrong if I had to serve up more than one version of any given library site-wide. So far I ve been successful in avoiding that, even for a very (VERY) large web application.

When it s time to upgrade, you upgrade. When it s not, you stick with a back-rev library. That s the way things work in general in any professional software project I m familiar with. I m sure there are exceptions, but I would say that keeping and serving multiple copies/versions is never a desirable situation.

[edit] by the way this really isn t that different from similar issues with multi-component server-side systems, or old-school client-server systems.

[another edit] Note that your clients will have to maintain separate copies of your library in their browser caches, and as they hop from page to page they ll be pulling down new copies all the time when they visit after a long absence (and the cache is old, in other words). With just one copy, they only have to download it at most once per visit, and it s even better if you leverage something like Google for jQuery, or whatever.

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签