I have a page as below;
quite possibly the simplest method ...
$var1, 'key2' => $var2, 'key3' => $var3); echo json_encode(change); ?>
Then the jquery script ...