Programming .Net 1 and 2
Programming .Net 1 and 2
NET
Competencies
3.1 Serialize, deserialize, send, and receive data by using XMLHTTP Request object
3.2 Simplify code that serializes, deserializes, sends, and receives data by using the jQuery Ajax method
3.3 Describe the benefits of structuring JavaScript code carefully to aid maintainability and extensibility
3.4 Explain best practices for creating custom objects in JavaScript
3.5 Describe how to extend custom and native objects to add functionality
JavaScript
What is JavaScript?
• Client side interpreted embedded programming language used to enhance
websites
o ECMA-262
• No relation to Java
• Event driven
1
To use or not to use
• Helpful for:
o Dynamic content
o Form validation
o Accessing resources
• External:
<!DOCTYPE html>
<html>
<body>
2
<p id="demo">JavaScript can change HTML content.</p>
</body>
</html>
Example
document.getElementById("demo").style.fontSize = "35px";
<!DOCTYPE html>
<html>
<body>
3
<button type="button"
onclick="document.getElementById('demo').style.fontSize='35px'">Click
Me!</button>
</body>
</html>
Click Me!
If you click the Click me button the attribute of the sentence above” JavaScript can change
the style of an HTML element.” Will be changed and becomes like this;
Example
document.getElementById("demo").style.display = "none";
<!DOCTYPE html>
<html>
<body>
<button type="button"
onclick="document.getElementById('demo').style.display='none'">Click
4
Me!</button>
</body>
</html>
Example
document.getElementById("demo").style.display = "block";
<!DOCTYPE html>
<html>
<body>
<button type="button"
onclick="document.getElementById('demo').style.display='block'">Click
Me!</button>
</body>
</html>
References
https://www.w3schools.com/js/js_whereto.asp
https://www.deped.gov.ph/wp-content/uploads/2019/01/Programming-.Net-
Technology-NC-III-CG.pdf
5
Measure Your Understanding
Activity 3.1.2
Create an HTML Document that displays your name with a button that
enables your name to disappear. Make your document using notepad++ screen shot
the output and the code.