I have various textnodes (p) and headers that I extract using jquery and store into an array :
var textnode = $(source).children("p:not(:has(img))").map(function () {
return $(this).outerHTML();
}).get();
var headerone = $(开发者_C百科source).children('h1').map(function () {
return $(this).outerHTML();
}).get();
I need to take the textnode array and headerone array and pass it via ajax to a php script (which will consequently store it in mysql). Does serializeArray work in this case or could I use .stringify. Would I need to .decode this in php (version 5.3.4)?
If you send it via jQuery Ajax, it will be automatically serialized and will be available to your PHP as a $_REQUEST array variable.
http://api.jquery.com/jQuery.ajax/
精彩评论