PDA

View Full Version : help with simple script



hantz
11-16-2007, 02:26 PM
<script>
var tId=""; // create global variable to hold the interval handler
function pollDB() {
/* call the server and when return, call the javascript function showResult with the result */
ajaxed.callback('poll', showResult);

}
function showResult(result) {
$('res').innerHTML = result; // put the result into the div with id="res"
}
// onLoad (or set the same in the page load asp thingy )
window.onload=function() { tId=setInterval('pollDB()',6000);
}

</script>

<div id="res"></div>

this script show the value it gets from other function and subs...but this is not the question
i just want it to be shown inside of javascript alert(browser alert, with ok button)...
how can i do this?

jscheuer1
11-16-2007, 04:17 PM
var tId=""; // create global variable to hold the interval handler
function pollDB() {
/* call the server and when return, call the javascript function showResult with the result */
ajaxed.callback('poll', showResult);

}
function showResult(result) {
alert(result); // alert result
}
// onLoad (or set the same in the page load asp thingy )
window.onload=function() { tId=setInterval('pollDB()',6000);
}