Two JavaScript programs demonstrated in this video, examine the code
button.htm
<html>
<head>
<title>Using buttons</title>
<script language="javascript">
function showAlert()
{
alert("Thanks for clicking.")
}
</script>
</head>
<body>
<h1>Using buttons</h1>
<form>
<input type="button" onclick="showAlert()" value="Click Here">
</form>
</body>
</html>- blusher.htm
<html>
<head>
<title>
Using JavaScript events
</title>
</head>
<body onmousedown="document.bgColor='pink'">
<h1>
Clicking this page will turn it pink.
</h1>
</body>
</html> - Just copy & paste them in notepad, save it with extension .htm and see the output on the Internet Browser.
2 comments:
Are there any security issues with AJAX?
JavaScript is in plain view to the user with by selecting view source of the page. JavaScript can not access the local filesystem without the user's permission. An AJAX interaction can only be made with the servers-side component from which the page was loaded. A proxy pattern could be used for AJAX interactions with external services.
You need to be careful not to expose your application model in such as way that your server-side components are at risk if a nefarious user to reverse engineer your application. As with any other web application, consider using HTTPS to secure the connection when confidential information is being exchanged.
Post a Comment