Skip to content

Instantly share code, notes, and snippets.

@dcneiner dcneiner/json.js Secret
Created Jun 14, 2010

What would you like to do?
// Run immediately
jQuery.getJSON('', function(html){
// Make sure DOM is ready:
$("#footer").before(html); // Example
<?php ob_start(); ?>
<h1>Extra HTML content here</h1>
$content = ob_get_contents();
$content = json_encode( utf8_encode( $content ) );
echo isset($_GET['callback']) ? $_GET['callback'] . '(' . $content . ');' : $content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.