If you want to load PHP file through AJAX use the below code.
function sendAJAX(){
$('#container').load(
"stuff.php", // url
{ // json object of data to pass to the page
stuff: "all your stuff goes in here...",
moreStuff: "even more stuff"
});
console.log('sendAJAX');
};
Let me know, In case of any doubts.
Related Posts:
- Load post content into div with ajax
- Stop WordPress Wrapping Images In A “P” Tag
- Stop WordPress automatically adding tags to post content
- How to detect single.php (but not single-portfolio.php)?
- How to make comments work for a post loaded per Ajax?
- Get content from one page and show it on another page
- Custom Single Post By Category
- Ajax Load More Posts in Category Page
- Using single.php from plugin folder instead of default template folder
- Strategy for handling hierarchical pages with empty parent content
- Custom permalink structure only for default posts
- Related Posts by Multiple Tags?
- How to load paginated post pages via ajax
- Getting the post_id in wp_ajax function
- How to remove Nextpage tag inside posts text depending of utm_campaign
- How do I create a link that will always show the latest post?
- How can you make sure authors’ posts are longer than 250 words?
- Can I load posts via Ajax?
- What is the best / efficient way to get WordPress content by post id and why?
- Load posts dynamically
- JSON not valid after json_encode posts
- How to load post content on index page using ajax when post title in sidebar is clicked
- Post X of Y in single.php / sidebar.php
- HTML code in Custom field
- How to use oEmbeds on Post Content during AJAX requests
- Add default content to post (for specific category)
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Cannot access current post’s ID in custom plugin
- Programmatically inserting page breaks
- How to have different content in the loop and single
- Single.php Active Category Class
- Hide parts of the post content on the home page
- Filter/Remove HTML Elements on all posts and pages
- Paragraphs removed when using get_post_custom()?
- POST from jQuery to PHP
- “Uncaught SyntaxError: Unexpected token
- How to add shortcode tags in single.php [closed]
- get_terms parent for current product only
- custom single.php not working
- Testing for post title in ‘if/else’ statement returns no content
- How to display different single post template based on author?
- WordPress theme ajax have_posts()
- Same content shared between multiple posts?
- The correct way to call posts with ajax
- How do I use Ajax to show the new posts realtime, on the frontpage
- Disable single post page
- how to know if the post has pagination () or not
- Remove arrows from previous and next link
- Load content in a div with ajax
- “next_posts_link” and “previous_posts_link” display me NOTHING
- How to get only text from wordpress post content?
- How to disable single post view in wp
- Custom Post Templates
- Add code just after Post content
- Pagination on single post page?
- How to create a load more post entries like Twitter?
- AJAX filter posts by year
- Batch process: remove first image from post content
- Restrict post navigation to current sub menu
- slideshow is not showing in a post call with ajax
- how to set beforsend option in wordpress ajax methods
- Can’t get the_content of the parent page from its single post?
- Filter Custom Post Type by Category with Ajax
- Ajax posts filter by date, comments, top views, top likes
- Add ajax load more function using WP API
- Show all posts in sidebar in single.php
- How to pass Post_ID variable from theme’s Single.php to custom Plugin using AJAX
- Why content_arr[‘extended’] removes paragraph tags?
- JSON – Permission Error?
- Ajax load more button in Recent posts widget
- Unautop / Sanitize content added to a post through a plugin
- Ajax Dynamic Archives not showing correct results
- WP_Query with ajax handler returns the same posts
- How to show single post page as home page
- Using wp_list_categories like the the_category (showing just current categories of a post)
- is there a way to show the the post title after the image?
- How to get rid of shortcodes in post content once and for all
- How can I make a post that belongs to a category or have specific tags, display different from the other single posts?
- Display all posts that were published before full post on single.php
- Add Word Limit to Posts
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Ajax post filters not working
- Show only one page link in content pagination
- Loading post with Ajax
- Genesis + Ajax + Jquery | Failling to call action
- Random ajax load only works with posts_per_page set to -1
- Add Read More Tag to a post content (Single.php)
- Send post id through ajax and get the post content back
- If in_category not working for multiple single.php pages
- Using ajax on editing a category edit page?
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- Show only posts with images and a fixed amount of posts
- Auto-realod with new posts // Ajax call
- How to create new post content templates for my users?
- Single.php – Get Current Parent Category
- How do I do a page break?
- Insert sometext after first h3 in content
- How to get a post’s content? [closed]
- Dynamically switch template on click