function myFunction()
<script type="text/javascript">
function myfunction(obj){
if (obj.checked)
{
alert("checked");
otherFunction()
/// Javascript körs aka otherFunction.
}
else
{
alert("Unchecked");
otherFunction()
/// Här ska otherFunction stoppas.
}
}
function otherFunction() {
window.setInterval(function() {
httpGetAsync('test.php', function(text) {
if (document.getElementById("test1").innerHTML >= 1000) {
alert("Test 2");
}
});
}, 10000);
}
</script>
<input type="checkbox" onclick="myfunction(this);" />
<script type="text/javascript">
function myfunction(obj){
if (obj.checked)
{
alert("checked");
otherFunction()
/// Javascript körs aka otherFunction.
}
else
{
alert("Unchecked");
otherFunction()
/// Här ska otherFunction stoppas.
}
}
function otherFunction() {
window.setInterval(function() {
httpGetAsync('test.php', function(text) {
if (document.getElementById("test1").innerHTML >= 1000) {
alert("Test 2");
}
});
}, 10000);
}
</script>
<input type="checkbox" onclick="myfunction(this);" />
<script type="text/javascript">
var functionHandle;
function myfunction(obj){
if (obj.checked)
{
alert("checked");
otherFunction();
/// Javascript körs aka otherFunction.
}
else
{
alert("Unchecked");
clearTimeout(functionHandle);
}
}
function otherFunction() {
functionHandle = window.setInterval(function() {
httpGetAsync('test.php', function(text) {
if (document.getElementById("test1").innerHTML >= 1000) {
alert("Test 2");
}
});
}, 10000);
}
</script>
<input type="checkbox" onclick="myfunction(this);" />
<script type="text/javascript">
var functionHandle;
function myfunction(obj){
if (obj.checked)
{
alert("checked");
otherFunction();
/// Javascript körs aka otherFunction.
}
else
{
alert("Unchecked");
clearTimeout(functionHandle);
}
}
function otherFunction() {
functionHandle = window.setInterval(function() {
httpGetAsync('test.php', function(text) {
if (document.getElementById("test1").innerHTML >= 1000) {
alert("Test 2");
}
});
}, 10000);
}
</script>
<input type="checkbox" onclick="myfunction(this);" />
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106
Flashback finansieras genom donationer från våra medlemmar och besökare. Det är med hjälp av dig vi kan fortsätta erbjuda en fri samhällsdebatt. Tack för ditt stöd!
Swish: 123 536 99 96 Bankgiro: 211-4106