Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var photoarray = [];
- var ajaxRequest = $.ajax
- ({
- url : "fhs_get_photos.php",
- type: "POST",
- dataType: "json",
- success: function(photo_array)
- {
- photoarray = photo_array;
- //line below works. the file name is correct but disappears
- //outside of this function
- console.log("photoarray[0][file_name] is: " + photoarray[0]['file_name']);
- },
- error: function(request, status, error)
- {
- alert('An error occurred: ' );
- }
- });
- // in fhs_get_photos.php
- // SELECT * FROM table......
- echo $json = json_encode($result);
- return $json;
- <h3>Welcome to the Historical Society's historical photo archive
- </h3>
- </header>
- <figure id="photo_figure">
- <script>
- //line below gets me: SCRIPT5007: Unable to get property 'thumb' of
- //undefined or null reference
- console.log("photoarray thumb: ") + photoarray[0]['thumb'];
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement