I am trying to code a simple customer mobile page.
On the first page, i have names of each customer. onclick
of one of them, it's open this file contain code below, however no data is loading. But if I try the refresh page, it works!
<script type='text/javascript' language='javascript'>
window.onload=function()
{
url = 'http://whateverorigin.org/get?url=' +
encodeURIComponent('http://www.mydomain.com/myphpfile.php') + '&callback=?';
$.ajax({
url: url,
dataType: 'json',
timeout: 4000,
success: function(reponse){
a=reponse.contents.split(';');
document.getElementById("client").innerHTML = a[0] ;
document.getElementById("adresse1").innerHTML = a[1] ;
},
});
}
</script>