Witam. Jak mam zadeklarowac zmienna aby wczytywala dane z innego pliku?
plik z ktorego ma wczytywac
$.ajax({
type: "GET",
url: "przyklad.php",
success: function(msg){
$(".selector-przykladowy").html(msg);
}
do
<script>
var ctx = document.getElementById('my_canvas').getContext('2d');
var al = 10;
var start = 4.72;
var cw = ctx.canvas.width;
var ch = ctx.canvas.height;
var diff;
function progressSim(){
diff = ((al / 100) * Math.PI*2*10).toFixed(2);
ctx.clearRect(0, 0, cw, ch);
ctx.lineWidth = 30;
ctx.fillStyle = '#ffffff';
ctx.strokeStyle = "#09F";
ctx.textAlign="center";
ctx.font="18px Arial";
ctx.fillText(al+'/100', cw*.5, ch*.9+2, cw);
ctx.beginPath();
ctx.arc(200, 200, 180, start, diff/10+start, false);
ctx.stroke();
if(al >= 100){
clearTimeout(sim);
// Add scripting here that will run when progress completes
}
}
var sim = setInterval(progressSim, 10);
</script>