jquery document load
$(document).ready(function() {
// code here
});
jquery document load
$(document).ready(function() {
// code here
});
jquery La méthode .load()
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>jQuery demo ajax load</title>
<script type="text/javascript" src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("div").load("livres.xml",function(response,status){
if (status=="success")
{
$("div").html("<ol></ol>");
$(response).find("titre").each(function(){
var txt1 =
$(this).text();
var txt2 = $(response).find("lien").text();
var text = '<a href="'+txt2+'"
target="_blank">'+txt1+'</a>'
$('<li></li>').html(text).appendTo('ol');
});
alert("Il y a
"+$(response).find("titre").size()+"
livres.\n Cliquez sur le nom du livre
pour voir l'offre le concernant.")
}
});
});
});
</script>
</head>
<body>
<h2>Des livres</h2>
<div></div>
<button>Execute</button>
<p><b>le
fichier xml utilisé pour cet exemple est ici <a href="livres.xml" target="_blank">livres</a></b></p>
</body>
</html>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us