мой JavaScript
Код: Выделить всё
$.ajax({
type: "POST",
url: url,
async: false,
data: {1:'Home', 2:'About', 3:'Contact'},
success: function(data){
alert(data);
//manipulate returned data here
));
}
});
Код: Выделить всё
function get_latest() {
$stack = array();
foreach($_POST as $key => $value) {
$tmpRec = db_fetch_object(db_query('SELECT * FROM node_revisions WHERE nid = "%s"', $key));
$arr = array($key => array('timestamp' => $tmpRec->timestamp, 'body' => $tmpRec->body));
array_push($stack, $arr);
}
echo '
' . print_r($stack,1) . ''; //works and comes up in alert
echo json_encode($stack); //Shows nothing
}
Подробнее здесь: https://stackoverflow.com/questions/724 ... javascript
Мобильная версия