Problème "id"

Fermé
none61 Messages postés 82 Date d'inscription mercredi 23 avril 2014 Statut Membre Dernière intervention 14 avril 2020 - Modifié par none61 le 21/10/2016 à 20:35
none61 Messages postés 82 Date d'inscription mercredi 23 avril 2014 Statut Membre Dernière intervention 14 avril 2020 - 22 oct. 2016 à 23:44
Bonsoir,

J'utilise une page index.html contenant un ID et son code javascript


<div id="exemple">
</div>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script
type="text/javascript">
var auto_refresh = setInterval(
function ()
{
$('#exemple').load('http://MON_IP/exemple.html').fadeIn("slow");
}, 100); // refresh every 1000 milliseconds
</script>



j'utilise du coup une page exemple.html contenant ceci:


<!doctype html>
<html lang="en">
<style>
#progress {
margin: 20px;
width: 200px;
height: 100px;
position: relative;
}
</style>
<div class="progress" id="progress">
<h1>test</h1>
</div>

<!-- These are probably out dated so you might want to use newest versions -->
<script src="http://192.168.1.16/dlprogressbar/progressbar.js"></script> <script src="main.js"></script>

<script language="javascript">
window.onload = function onLoad() {
var bar = new ProgressBar.SemiCircle('#progress', {
color: '#aaa',
// This has to be the same size as the maximum width to
// prevent clipping
strokeWidth: 4,
trailWidth: 1,
easing: 'easeInOut',
duration: 1400,
text: {
autoStyleContainer: false
},
from: { color: '#7CFC00', width: 1 },
to: { color: '#ED6A5A', width: 4 },
// Set default step function for all animate calls
step: function(state, circle) {
circle.path.setAttribute('stroke', state.color);
circle.path.setAttribute('stroke-width', state.width);

var value = Math.round(circle.value() * 100);
if (value === 0) {
circle.setText('');
} else {
circle.setText(value);
}

}
});
bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
bar.text.style.fontSize = '2rem';

bar.animate(1.0); // Number from 0.0 to 1.0


};
</script>
</html>


Mon souci:

- Si j'appel directement ma page exemple.html, tout fonctionne comme il faut.
-
Par contre si j'appel ma page index.html seul le mot test apparait , la "progressbar" ne s'affiche pas...

Je suis passé a coté de quelque chose??

Merci pour votre aide

1 réponse

none61 Messages postés 82 Date d'inscription mercredi 23 avril 2014 Statut Membre Dernière intervention 14 avril 2020
22 oct. 2016 à 23:44
Personne n'a d'idée ?
0