i have this function which i define inside HEAD:
Put your code in an separate <script>
tag. As soon as a <script>
tag has a src
attribute, any content of that tag is ignored in favor of the given resource. so just do this:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script>
function live() {
$.get("http://mydomain.com/script.php", function(data){
var timer = data;
var elm = document.getElementById("live");
if (timer == 1){
elm.style.display = 'block';
} else{
elm.style.display = 'none';
}
});
}
</script>