In this weeks lecture in website design i got taught JavaScript.
The pro's of Javascript are:
-The speed of JavaScript is quick because it is client side which means it doesn't contact a server to get answers.
-JavaScript runs well with most other programing languages, and can run well within PHP and HTML.
The cons of JavaScript are:
-The security is not very good with JavaScript because you can make malicious scripting.
-JavaScript is sometimes interpreted differently by different browser.
The first part of JavaScript was to make a pop up box appear on the screen the code i used for this was:
<head> This is the head where the script type goes to say its a JavaScript script.
<script type="text/javascript"> This is the script type which is JavaScript
alert("POP UP"); This says make an alert which is a pop up and creates the text in the pop up saying "POP UP"
</script> This ends the script type
</head> This ends the head
<body>This is the body
<script type="text/javascript"> This starts the script type of JavaScript again
document.writeln("<p>this line was written by javascript</p>"); This says write a line in the document and say whats in the brackets and speech marks.
</script> This ends the script tag
This will be displayed after the 'alert' dialog box popped up... This is in the body and says what i typed.
</body> This ends the body
</html>This ends the HTML
This script makes a pop up box and when the pop up box gets closed it creates some text.
No comments:
Post a Comment