Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Aug 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    java script question

    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
    Last edited by ashishy; 08-30-2010 at 05:29 AM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •