admin管理员组

文章数量:1315315

While on-site with a client, I was proposing an upgrade of the jQuery version the client is using (ie, from jQuery 1.5 to 1.11). The client has minor concern that their version of TimeGlider won't be patible with the newer jQuery. I'm not familiar with TimeGlider, so they browsed (wth Chrome) to a page with TimeGlider to demonstrate it to me.

I thought I'd be slick and "upgrade" the DOM's jQuery library, using developer tools, to settle the question immediately. I know one way to import the jQuery 1.11 library, but this technique would necessitate a simple way to first remove the old jQuery version. Perhaps there's a better approach.

Of course this is trivial to edit within the sourcecode, but I really wanted to do it within the DOM, via developer tools.

How can I "upgrade" the jQuery version within the DOM?

While on-site with a client, I was proposing an upgrade of the jQuery version the client is using (ie, from jQuery 1.5 to 1.11). The client has minor concern that their version of TimeGlider won't be patible with the newer jQuery. I'm not familiar with TimeGlider, so they browsed (wth Chrome) to a page with TimeGlider to demonstrate it to me.

I thought I'd be slick and "upgrade" the DOM's jQuery library, using developer tools, to settle the question immediately. I know one way to import the jQuery 1.11 library, but this technique would necessitate a simple way to first remove the old jQuery version. Perhaps there's a better approach.

Of course this is trivial to edit within the sourcecode, but I really wanted to do it within the DOM, via developer tools.

How can I "upgrade" the jQuery version within the DOM?

Share Improve this question edited Jun 12, 2018 at 14:16 Jeromy French asked Dec 17, 2014 at 21:45 Jeromy FrenchJeromy French 12.1k19 gold badges78 silver badges135 bronze badges 2
  • As far as I know, you don't need to remove the old version, because the new script tag you add will overwrite the jQuery variable with the newer version. You actually have to use the noConflict option if you want to be able to use multiple jQuery versions on the same page, so your script tag solution should just work. – Zack Commented Dec 17, 2014 at 21:50
  • If the plugin is well written then it already has a reference to the "old" jquery passed in as a parameter (replacing the global jquery will have no effect). Not to mention the fact that whatever initialization it has done was already done with the old version as well. – James Montagne Commented Dec 17, 2014 at 21:53
Add a ment  | 

1 Answer 1

Reset to default 16
  • Go to the Sources tab.
  • Find jQuery file (cmd+p / ctrl+p).
  • Add a breakpoint in the first (non-ment) line of the script.
  • Reload page.
  • When execution stops, select whole contents of the file and replace them with contents of jquery-1.11.0.min.js.
  • Save the changes (cmd+s / ctrl+s).
  • File will repile and website will run jQuery 1.11.0.

本文标签: javascriptHow can I quotupgradequot the jQuery version within the DOMStack Overflow