So-called Application Programming Interfaces ( APIs) provide you with extra superpowers to use in your JavaScript code.ĪPIs are ready-made sets of code building blocks that allow a developer to implement programs that would otherwise be hard or impossible to implement. What is even more exciting however is the functionality built on top of the client-side JavaScript language. We used a click event in our example above to detect when the button is clicked and then run the code that updates the text label. Running code in response to certain events occurring on a web page.In the above example we take the string "Player 1: " and join it to the name variable to create the complete text label, e.g. Operations on pieces of text (known as "strings" in programming).In the above example for instance, we ask for a new name to be entered then store that name in a variable called name. The core client-side JavaScript language consists of some common programming features that allow you to do things like: We can mark it up using HTML to give it structure and purpose: Let's take a simple text label as an example. The three layers build on top of one another nicely. (Okay, not everything, but it is amazing what you can achieve with a few lines of JavaScript code.)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |