{"id":641,"date":"2012-05-29T08:38:31","date_gmt":"2012-05-29T08:38:31","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=641"},"modified":"2012-05-29T08:38:31","modified_gmt":"2012-05-29T08:38:31","slug":"jquery-serialize-array-to-string","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/jquery-serialize-array-to-string\/","title":{"rendered":"jQuery Serialize Array to String Example"},"content":{"rendered":"<p><strong>Serializing an Array<\/strong> will let you convert an array into JSON format that you can post for AJAX operations. Here is a simple way to use\u00a0<strong><em>jQuery to Serialize Array to String<\/em>.<\/strong><!--more--><\/p>\n<h2>How to Serialize Array to String using jQuery &#8211; Example<\/h2>\n<p>Assuming that you have an array of form input elements and you would like to serialize it, here is how to do it:<\/p>\n<h3>Example: Serialize Array Values to String using jQuery<\/h3>\n<pre class=\"lang:xhtml decode:true\" title=\"Example to serialize array values to string using jQuery\">var fields = $(\":input\").serializeArray();\n\n\/\/You can now use this to post via AJAX as:\n\n$.ajax({\nurl: \"ajaxpage.php\",\ntype: \"POST\",\ndata: fields,\n....\n});<\/pre>\n<h5>That&#8217;s it!<\/h5>\n<p>Do you know of any other ways to use\u00a0<em><strong>jQuery to Serialize Array to String<\/strong><\/em>? Feel free to share by commenting below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Serializing an Array will let you convert an array into JSON format that you can post for AJAX operations. Here is a simple way to use\u00a0jQuery to Serialize Array to String.<\/p>\n","protected":false},"author":1,"featured_media":395,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20,13],"tags":[41],"class_list":["post-641","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery-tips-and-tricks","category-tips-and-tricks","tag-jquery-tips"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-al","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/641","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=641"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/641\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=641"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=641"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}