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 2 of 2

Thread: Property list

  1. #1
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post

    Property list

    I'm sending arrays of results from my server in response to an xmlhttprequest like so:

    Code:
    array({key:value[,...]}[,...]);
    I know I could use an associative or indexed array, but this is just how I wrote it as I'm using the prototype library and I'm in the habit.

    Anyway, I want to know if I can reference 'key'. If so, umm, how?
    Omnis mico antequam dominus Spookster!

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,503
    Thanks
    3
    Thanked 500 Times in 487 Posts
    post you a std snippet which uses keys
    Code:
    function zxcES(zxcele,zxcstyle,zxcp,zxctxt){
     if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
     for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
     if (zxcp){ zxcp.appendChild(zxcele); }
     if (zxctxt){ zxcele.appendChild(document.createTextNode(zxctxt)); }
     return zxcele;
    }
    
      var zxcimg=zxcS('IMG',{position:'absolute',left:zxcw1+'px',top:(zxcImgAry1[zxc0][3]+476)+'px',width:zxcImgAry1[zxc0][1]+'px',height:zxcImgAry1[zxc0][2]+'px'},zxcp);
    Vic

    God Loves You and will never love you less.

    http://www.vicsjavascripts.org/Home.htm

    If my post has been useful please donate to http://www.operationsmile.org.uk/


  •  

    Posting Permissions

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