SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2005
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SAJAX and Javascript Objects

    As everybody knows, Javascript doesn't support associative arrays.
    So this is not possible in javascript:

    var myVar=new Array();
    myVar['name']='John';
    myVar['phone']='6164651';

    The only way to deal with this is using an object:

    var myVar=new Object();
    myVar.name='John';
    myVar.phone='6164651';

    Then, I need to send the data to php (php must convert it into an array...)

    for example:

    <?php function result_hander($data){
    print $data['name'];
    // This should print 'John';

    }

    Any help will be great.
    Last edited by mysticav; Jun 26, 2006 at 15:07.

  2. #2
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use PHPRPC instead of Sajax. It esay to use than Sajax.

    Here is a manual of PHPRPC:
    http://www.coolcode.cn/?p=148


Bookmarks

Posting Permissions

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