0

I'm trying to make an infinite loop in jQuery. I understood the basic syntax was

$(document).ready(function(){
 function helloworld() {
    alert("hello, world!");
helloworld();
}
});

... but this does nothing. How would I do this? Thanks!

1
  • just call function with helloworld(); then it's starting with infinite loop. Commented Apr 6, 2017 at 11:35

3 Answers 3

1
$(document).ready(function(){
 function helloworld() {
    alert("hello, world!");
    helloworld();
}
helloworld();
});
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks - this is what I'd been trying actually - forgot to type it in properly. So the problem must be with my internal function - I shall create a new question...
0
while (1) {
    alert("hello, world!");
}

use this this will alert infinite time

Comments

0

This is also infinite function :D

function myfn() {
    console.log("hello, there!");
    myfn();
}
myfn();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.