Return to Snippet

Revision: 56107
at March 10, 2012 03:17 by Narayon

Initial Code
<script type="text/javascript">
    document.getElementByID('submitButton').onclick = function() {
        var movies = <?php echo json_encode($movies); ?>;
<input type="submit" value="Test JavaScript" id="submitButton">

Initial URL

Initial Description
Writing an PHP array in a javascript file with json_encode.

Initial Title
Pass PHP array parameter to Javascript Function

Initial Tags
javascript, php, array, json

Initial Language