VB icon

Objects in JavaScript

Email
Submitted on: 8/16/2015 12:53:06 PM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: CSS, JavaScript
Views: 2371
author picture
 
     In this article I would like to share with you sample program in JavaScript that will teach you how to create an object and calling an object. Objects is a basic thing in Object Oriented Programming principle which contains properties and methods. The code is very simple and easy to understand. If you have some questions about programming, about my work please send mu an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com. People here in the Philippines can contact me at my mobile number 09173084360. Thank you very much and Happy Programming.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: Objects in JavaScript
' Description:In this article I would like to share with you sample program in JavaScript that will teach you how to create an object and calling an object. Objects is a basic thing in Object Oriented Programming principle which contains properties and methods. The code is very simple and easy to understand.
If you have some questions about programming, about my work please send mu an email at jakerpomperada@gmail.comand jakerpomperada@yahoo.com. People here in the Philippines can contact me at my mobile number 09173084360.
Thank you very much and Happy Programming.
' By: Jake R. Pomperada
'**************************************

<html>
<head>
<title> Objects in JavaScipt</title>
<head>
<style>
		h1,h3 {
		 font-family:arial;
			 color: blue;
		};
	 </style>		 
<body> 
	 <h1> Objects in JavaScript </h1>
	 <br>
 <script>
var person = {
firstname : 'Jacob Samuel',
lastname : ' Pomperada ',
greet : function(persons_name) {
alert(' Hello ' + persons_name + ' How are you today? ');
},
greet2 : function() {
alert('Hi ' + this.firstname + ' ' + this.lastname + ' God Bless you');
} 
};
document.write('<h3> Persons First Name: ' + person.firstname + '</h3>');
document.write('<br>');
document.write('<h3> Persons Last Name: ' + person.lastname + '</h3>');
person.greet('jacob');
			person.greet2('jacob');
</script>
</body>
</html>


Other 108 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.