jquery / jquery/learn.jquery.com
Need to resolve conflict to Multiple jQuery's from single page
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 915
- Forks
- 471
- PR merge metrics
- No merged PRs in 30d
Description
I have initialized window.jQuery = jQuery; now, i want to add some prototype functions with different jQueries, like
var a = window.jQuery;
var b = window.jQuery;
a.fn.helloWorld = () => 1;
b.fn.helloWorld = () => 2;
console.log(a.fn.helloWorld()); // 2
console.log(a.fn.helloWorld()); // 2
In this case, when i use noConflict from a variable, then b has undefined then, how can i use jquery for this case?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the issue's jQuery variable example and the documented noConflict behavior. Clarify the supported way to use multiple jQuery instances, then update the relevant learning content so the expected behavior and usage are explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100