...

View Full Version : java script question



ashishy
08-30-2010, 06:24 AM
Hi,

if you are deleting this thread please let me know in which section of javascript programming should i post this question

i have been going through the tutorial section in http://www.javascriptkit.com/javatutors/

i went throught this article "Adding properties to a literal in JavaScript". The page is http://www.javascriptkit.com/javatutors/proplit.shtml. i have executed the script which is given at the end of the page i.e

y = "JavaScript"
function myFunc2(obj) {
obj = new obj.constructor(obj)
obj.myProp = new Object()
// returns [object Object] when calling myFunc2(y)
alert(obj.myProp)
}

my question is:
i wish to know how will i get the value that is there in the variable y because the last statement
alert(obj.myProp);
displays "object object" in the message box.

Regards,
Ashish



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum