jquery Programming Glossary: post_id
rails ajax fav button for user posts http://stackoverflow.com/questions/6899037/rails-ajax-fav-button-for-user-posts def create current_user.favorites.create post_id params post_id render layout false end Routes match favorites.. def create current_user.favorites.create post_id params post_id render layout false end Routes match favorites post_id favorites#create.. post_id render layout false end Routes match favorites post_id favorites#create as favorite jQuery .favorite .click function..
Load Wordpress post content into DIV using AJAX http://stackoverflow.com/questions/7526113/load-wordpress-post-content-into-div-using-ajax function .ajaxSetup cache false .trick .click function var post_id this .attr rel #single home container .html loading... #single.. .load http php echo _SERVER HTTP_HOST single home id post_id return false INDEX.PHP php get_header home div id home home.. captured in the rel attribute and loaded properly in the post_id variable I inserted an alert call back on the AJAX JQUERY snippet..
Including PHP variables in an external JS file? http://stackoverflow.com/questions/9653651/including-php-variables-in-an-external-js-file type 'POST' url 'http domain.com ajax add_love' data post_id php echo post id user_id php echo active_user id php echo.. ' data post id ' .click function var el this var data 'post_id' el.data 'post id' 'user_id' Globals.active_user_id data Globals.token..
rails ajax fav button for user posts http://stackoverflow.com/questions/6899037/rails-ajax-fav-button-for-user-posts model belongs_to user belongs_to post Controller # favorites_controller.rb def create current_user.favorites.create post_id params post_id render layout false end Routes match favorites post_id favorites#create as favorite jQuery .favorite .click.. user belongs_to post Controller # favorites_controller.rb def create current_user.favorites.create post_id params post_id render layout false end Routes match favorites post_id favorites#create as favorite jQuery .favorite .click function var.. def create current_user.favorites.create post_id params post_id render layout false end Routes match favorites post_id favorites#create as favorite jQuery .favorite .click function var post_id this .attr 'id' .ajax type POST url 'favorites..
Load Wordpress post content into DIV using AJAX http://stackoverflow.com/questions/7526113/load-wordpress-post-content-into-div-using-ajax markup so far THE AJAX JQUERY IN HEADER.PHP document .ready function .ajaxSetup cache false .trick .click function var post_id this .attr rel #single home container .html loading... #single home container .load http php echo _SERVER HTTP_HOST single.. #single home container .html loading... #single home container .load http php echo _SERVER HTTP_HOST single home id post_id return false INDEX.PHP php get_header home div id home home bg img class home bg src php bloginfo 'template_url' images.. to resolve the issue Here's what I did 1. Test if post ID is captured in the rel attribute and loaded properly in the post_id variable I inserted an alert call back on the AJAX JQUERY snippet to see if the post ID was even loading into the post_id..
Including PHP variables in an external JS file? http://stackoverflow.com/questions/9653651/including-php-variables-in-an-external-js-file .ready function '.post php echo post id ' .click function .ajax type 'POST' url 'http domain.com ajax add_love' data post_id php echo post id user_id php echo active_user id php echo token ' php echo hash ' dataType 'json' success function response.. then your JavaScript may look like document .ready function ' data post id ' .click function var el this var data 'post_id' el.data 'post id' 'user_id' Globals.active_user_id data Globals.token Globals.hash .ajax 'type' 'POST' 'url' 'http domain.com..
|