Nothing happens? | SoloLearn: Learn to code for FREE!


Nothing happens?

This is my first time using J̛͜͢Qu͏ȩ̴r̨̛y͘ can someone help me with the code. I want it to alert when the user uses í̶̸̧͜o̸͝s̨͘͟͜͞ device and i want it to alert something else if any other device. I also want the background gif to appear when switch toggled on.

6/22/2018 8:44:44 PM


3 Answers

New Answer


🅿️®️⭕️_e✖️e ,First of all, you are not to use double Window.onload


just saying, using jQuery and JavaScript in the same code would sometimes confuse people reading your code, for example you used window.onload you could use jQuerys equivalent $(document).ready(function(){ // your code to run when the page loads }); and line 15, instead of document.getElementById() you can use var elem = $("#myElement"); which does the same thing...I could keep going but those are just a couple tips


Mystique is right plus there is a 'while' statement in your script that will never evaluate to true as the script stands now.