{"id":9666,"date":"2011-04-15T08:00:00","date_gmt":"2011-04-15T08:00:00","guid":{"rendered":"https:\/\/www.weixiaoduo.com\/plugins\/2024\/02\/22\/ahax\/"},"modified":"2011-04-15T09:56:00","modified_gmt":"2011-04-15T09:56:00","slug":"ahax","status":"publish","type":"post","link":"https:\/\/www.weixiaoduo.com\/plugins\/ahax\/","title":{"rendered":"AHAX"},"content":{"rendered":"<p>AHAX is a drop-in solution that allows theme or plug-in developers to take advantage of a very simple and streamlined way of making AJAX requests.<\/p>\n<p>The goal of this plugin is to make the process of setting up an AJAX request as simple as possible.<\/p>\n<p>This plugin centers AJAX requests around an \u201caction.\u201d This action is \u201cbound\u201d to a function (handler) on the back-end and called to from front-end via a custom JavaScript class method \u2014 this process is demonstrated below.<\/p>\n<h4>Back-End<\/h4>\n<pre><code>ahax::bind( 'get_random_number', 'generate_number' ); function generate_number($output) {     $max = abs( ( int ) $_POST['max'] );     $output = mt_rand( 0 , ( $max <= 1000 ? $max : 1000 ) );     return $output; } <\/code><\/pre>\n<h4>Front-End<\/h4>\n<pre><code>var ahax = new AHAX(); ahax.post( 'get_random_number', { max : 1000 }, function( response ) {     jQuery( '#ahax_number' ).html( response ); }); <\/code><\/pre>\n<h4>Website<\/h4>\n<p>http:\/\/dan.doezema.com\/2011\/04\/ahax-wordpress-plugin<\/p>\n<h4>Author<\/h4>\n<p><a href=\"http:\/\/dan.doezema.com\" rel=\"nofollow ugc\">Daniel Doezema<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A plugin that provides easier access to AJAX functionality within plugins and themes.<\/p>\n","protected":false},"author":65,"featured_media":231781,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"AHAX - \u8587\u6653\u6735\u63d2\u4ef6\u76ee\u5f55","description":"A plugin that provides easier access to AJAX functionality within plugins and themes."},"footnotes":""},"categories":[1],"tags":[3833,3834,476,3835,3836,282,826,3837,768],"class_list":["post-9666","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-action","tag-ahax","tag-ajax","tag-bind","tag-dependancy","tag-development","tag-javascript","tag-public","tag-theme"],"_links":{"self":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/9666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/comments?post=9666"}],"version-history":[{"count":0,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/posts\/9666\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media\/231781"}],"wp:attachment":[{"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/media?parent=9666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/categories?post=9666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weixiaoduo.com\/plugins\/wp-json\/wp\/v2\/tags?post=9666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}