Use JavaScript Alerts To Debug Your Code Or Alert Visitors

Pubblicato il: 07 aprile 2017
sul canale di: Full Stack Coding Tutorials
671
6

Use JavaScript Alerts To Debug Your Code Or Alert Visitors    • Use JavaScript Alerts To Debug Your Code O...  

JavaScript Alerts allow you to alert your visitors to certain things that happen on the website. They are quite intrusive and rarely used these days. They can be used to great effect on a development site to debug your code.

To create a JavaScript all you have to do is add this line anywhere in your script:

alert("THIS IS MY ALERT");

alert(myVar);

There are two different version there. The first one will create an alert that displays a hardcoded string of characters.

The second on will display the value of a variable. That variable needs to be set before the alert is generated. If not, the alert will still be generated, but it won't display any contents.

You can insert as many js alerts as you need to debug various parts of your code. You can also use JavaScript console log to debug your script. It's just as easy to use and a little less intrusive.

That's all there is to it. I hope this video helps you! If you have any questions, please leave them in the comments below. And before you go, subscribe and like :)

If you're into Wordpress, check out my WPLearningLab channel to learn more about WordPress so you can earn more for yourself, for your clients or for your business.


In questa pagina del sito puoi guardare il video online Use JavaScript Alerts To Debug Your Code Or Alert Visitors della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Full Stack Coding Tutorials 07 aprile 2017, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 671 volte e gli è piaciuto 6 spettatori. Buona visione!