Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Update JQuery
authored
Apr 26, 2022
by
Joel H
Show whitespace changes
Inline
Side-by-side
Web/Javascript/JQuery.md
View page @
483b3859
...
...
@@ -97,9 +97,16 @@ $(.box').on('click', '.box-button', function(){ //equivalent of AddEventListener
//Asynchronous JS And XML
//Si on demande le fichier seulement comme ca, ca ne marche pas car le navigateur n'a pas le droit de lire les fichiers locaux.
//Il faut passer par un serveur. (CORS policy error)
$
.
ajax
(
'
data/item.json
'
,
function
(
response
){
$
.
ajax
(
'
data/item.json
'
)
.
done
(
function
(
response
){
console
.
log
(
response
);
});
})
.
fail
(
function
(
request
,
errorType
,
errorMessage
){
console
.
log
(
errorMessage
);
})
.
always
(
function
(){
console
.
log
(
"
always called
"
);
})
```
\ No newline at end of file