learn.jquery.com: Deprecated and Beaking Changes
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Documentazione
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, jquery
- Ambito
- documentation
Direzione di ricerca
Inizia dal Learning Center collegato e dalla pagina Code Organization/object literals, quindi confronta gli esempi documentati con i casi di jQuery 1.8.3, 3.0.0 e 3.1.1 descritti qui. Aggiorna la documentazione con indicazioni ed esempi specifici per versione per i pattern interessati, affrontando chiaramente il comportamento deprecato e quello non funzionante.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I find myself struggling for answers, that just do not seem to be available anywhere. Trying to use
object literals as shown in the Learning Center leads to warnings, upgrading jQuery leads to the code not working.
//Using an object literal for a jQuery feature
var myFeature = {
init: function() {
console.log(Math.random());
}
};
myFeature.init();
| Version | Console |
|---|---|
| jquery-1.8.3.js | Use of getPreventDefault() is deprecated. Use defaultPrevented instead. |
| jquery-migrate-3.0.0.js | jQuery.fn.load() is deprecated. |
| jquery-3.1.1 | TypeError: url.indexOf is not a function. |
I was able to find a different way to do it. But I ended up the same results. So the following code does not bring me any closer to building object literals in 3.1.1
// Create your own jQuery function
jQuery.fn.extend({
init: function () {
console.log(Math.random());
}
});
$.fn.init();
So how is this an issue? Well, versions changes have affected the fundamental use. But the Learning Center only provides one (outdated) example.
$( document ).ready( myFeature.init ); // Deprecated
$( document ).on( 'ready' , myFeature.init ); // Deprecated?
$.fn.myFeature.init; // Is this the correct way?
I suggest the Learning Center is updated with version specific documentation that shows relative examples for each version. I would like to help, but skill level is rather low.
Sincerely,
Brian LaVallee
- Lingua principale
- JavaScript
- Stelle
- 914
- Fork
- 472
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jquery/learn.jquery.com
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
jquery/learn.jquery.com#828 ·
-
Word(s) missing in article?Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. ApertaChapter: events
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
jquery/learn.jquery.com#751 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
jquery/learn.jquery.com#814 · 1 commento ·
-
Chapter: jquery-core help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
jquery/learn.jquery.com#799 ·
-
Chapter: plugins
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
jquery/learn.jquery.com#796 ·
Tutte le issue di jquery/learn.jquery.com
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
good first issue help wanted javascript up-for-grabs
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
andrewsiah/agentswarm-data-tasks#307 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
coder/claudecode.nvim#588 ·
I maintainer di solito rispondono entro 1 giorno
-
area: web tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
digitalbazaar/http-client#60 ·