Title: Disable Ajax functionality
Last modified: August 21, 2016

---

# Disable Ajax functionality

 *  Resolved [teti86](https://wordpress.org/support/users/teti86/)
 * (@teti86)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/)
 * Hi, great plugin.
 * I would like to know if it’s possible to disable Ajax functionality and manage
   the vote update only server side (by refresh the page) because if an user has
   javascript disabled on his browser he can’t vote.
 * Thanks!
 * [http://wordpress.org/plugins/i-recommend-this/](http://wordpress.org/plugins/i-recommend-this/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571372)
 * [@teti86](https://wordpress.org/support/users/teti86/), that would be possible
   but you would need to edit lot of the plugin and some extra functionality (similar
   to comments) where on clicking some data with ID would be passed to another page
   which could process and return user back to the previous page where they clicked.
   
   I am afraid I would not be able to assist you with this, but if you do develop
   it, would appreciate if you could share.
 *  Thread Starter [teti86](https://wordpress.org/support/users/teti86/)
 * (@teti86)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571373)
 * Thanks Harish, I supposed it.
    Maybe there is possible to only refresh page when
   an user vote without modified lot of the plugin?
 * Thanks again.
 *  Plugin Author [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571374)
 * [@teti86](https://wordpress.org/support/users/teti86/), I think it would involve
   few steps. Right due to many in-built WP functions its easier to call a function
   inside a plugin using basic JavaScript & AJAX provided by WP. So to bypass it
   and use direct page refresh, first the ajax refresh would have to be disabled
   and some form with post method would have to be introduced.
 *  Thread Starter [teti86](https://wordpress.org/support/users/teti86/)
 * (@teti86)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571377)
 * I try this solution, it seems to work.
 * 1- commented file dot_irecommendthis.js
    2- replaced the `<a>` button (inside
   the dot-irecommendthis.php file) with a form with an hidden input field with 
   the post_id value and a submit button. This form is set to method post. 3- create
   a custom page template that process the vote request (check if the cookies or
   ip already exist, update post meta, insert the ip on database, set the cookies)
   and then redirect to the contest page.
 *  Plugin Author [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571412)
 * [@teti86](https://wordpress.org/support/users/teti86/) Thanks for the update.
   If you could share the code, I can try testing it within the plugin to allow 
   users this option.
 *  Thread Starter [teti86](https://wordpress.org/support/users/teti86/)
 * (@teti86)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571437)
 * Sorry for waiting. Sure, I can share the code but probably you can do it better.
 * 1- I create another text option (and its relative function) to “dot-irecommendthis.
   php”
 *     ```
       add_settings_field( 'contest_page', __( 'Insert page url to return after vote', 'dot' ), array(&$this, 'setting_contest_page'), 'dot-irecommendthis', 'dot-irecommendthis' );
       ```
   
 * This option add a news text field on the setting panel of the plugin.
 * 2- comment the js file to remove the ajax call
 * 3- create a wordpress page template called “verify-template.php” and create a
   page with this template. This template contain the code that retrieve the post
   id with $_POST[‘recommend_id’], get and update the post meta, set cookie, and
   insert in the DB the ip. After that redirect to the page set in the option $options[‘
   contest_page’].
 * 4- remove the a link in the “dot-irecommendthis.php” file (row 654) and add a
   form:
 *     ```
       $dot_irt_html .= '<form action="http://www.mydomain.it/verify/" method="post">';
       $dot_irt_html .= '<input type="hidden" name="recommend_id" value="'. $post_ID .'">';
       $dot_irt_html .= '<button type="submit">Vota</button>';
       $dot_irt_html .= apply_filters( 'dot_irt_before_count', $output );
       $dot_irt_html .= '</form>';
       ```
   
 *  Plugin Author [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571439)
 * Thansks mate. This is helpful. I will try adding it on my site. let me know if
   there is any site links of yours to give credit ti.
 *  Thread Starter [teti86](https://wordpress.org/support/users/teti86/)
 * (@teti86)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571440)
 * Thanks to you for the plugin =)
    I forgot one thing. The form is outputted (I
   don’t know if “outputted” is the correct word =D) only if cookies aren’t set 
   or ip isn’t in database. So if a person has already voted can not see the form
   and the submit button.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Disable Ajax functionality’ is closed to new replies.

 * ![](https://ps.w.org/i-recommend-this/assets/icon.svg?rev=3333860)
 * [I Recommend This – Love/Like Button for WordPress Posts](https://wordpress.org/plugins/i-recommend-this/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/i-recommend-this/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/i-recommend-this/)
 * [Active Topics](https://wordpress.org/support/plugin/i-recommend-this/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/i-recommend-this/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/i-recommend-this/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [teti86](https://wordpress.org/support/users/teti86/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/disable-ajax-functionality/#post-4571440)
 * Status: resolved