Skip to content

Instantly share code, notes, and snippets.

@pedrofaria
Created August 12, 2011 19:19
Show Gist options
  • Save pedrofaria/1142766 to your computer and use it in GitHub Desktop.
Save pedrofaria/1142766 to your computer and use it in GitHub Desktop.
<?php
if ($_GET['foo']) {
$array = array(
'data' => array(
array(0, '3212', '2144'),
array('0', '5461', '3524')
)
);
print json_encode($array);
exit;
}
?>
<html>
<head>
<title>Foo</title>
<script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
</head>
<body>
aee
<script>
(function($) {
$.getJSON('teste.php?foo=1', function(response) {console.log(response);});
})(jQuery);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment