#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Posts
    6
    Rep Power
    0
    I have created an array called $array_1 in PHP and I am trying to send it to a Javascript function. I can't seem to get the function to read the array. The code used to send the array and the function are below. Am I missing something?

    function test_js(array_var)
    {alert (array_var.length);
    var index = 0;
    }


    <?php echo"<a href=\"#nothing\" onmousedown=\"test_js($array_1)\">click</a>"; ?>

    Thanks,

    Shawn
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Posts
    6
    Rep Power
    0
    figured it out, needed to wrap the parameter with <? ?> and quotes of course.

    thanks.

IMN logo majestic logo threadwatch logo seochat tools logo