i have a problem with python script and javascript script in a website. I have this website http://www.orangedropdesign.com/progetti/default/ and in the source i can view this script:
`
var idDebitoPubblico = "debito";
var idDebitoTesta = "Testa";
var valoreInizialeDebito = Math.round(1449.361*1321693021);
var incremento = 851; //8515 a sec
var valoreCorrente = valoreInizialeDebito;
var valoreTesta;
function incrementaDebitoPubblico(){
var el = document.getElementById(idDebitoPubblico);
valoreCorrente += incremento;
var importo = applicaSeparatore(valoreCorrente);
el.innerHTML = importo;
valoreTesta = valoreCorrente/60700000;
var procapite = applicaSeparatore(Math.round(valoreTesta*100)/100);
document.getElementById("testa").innerHTML = procapite;
setTimeout(incrementaDebitoPubblico, 100);
}
setTimeout(incrementaDebitoPubblico, 100);
function applicaSeparatore(importoNumerico){
var importo = importoNumerico.toString();
importo = importo.replace(".", ",")
if(importo.length>3){
importo = importo.split('',importo.length).reverse().join('').replace(/([0-9] {3})/g,'$1.');
importo = importo.split('',importo.length).reverse().join('');
}
return importo;
}
How can I read the website and use “importo” variable with a Python script?
Get your basics right.
Javascript is client-side.Python is server side. Make this clear.So basically how can these two access variables of each other. In simple terms not possible.
The only workaround it to explicitly send that variables content via an ajax call.
This might help you :
http://api.jquery.com/category/ajax/