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
- Custom Single Post By Category
- Ajax Load More Posts in Category Page
- Using single.php from plugin folder instead of default template folder
- Related Posts by Multiple Tags?
- How to remove Nextpage tag inside posts text depending of utm_campaign
- 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?
- JSON not valid after json_encode posts
- How to load post content on index page using ajax when post title in sidebar is clicked
- 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
- Hide parts of the post content on the home page
- Filter/Remove HTML Elements on all posts and pages
- “Uncaught SyntaxError: Unexpected token
- custom single.php not working
- Testing for post title in ‘if/else’ statement returns no content
- Load content in a div with ajax
- Add code just after Post content
- 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
- Filter Custom Post Type by Category with Ajax
- Ajax posts filter by date, comments, top views, top likes
- 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?
- Unautop / Sanitize content added to a post through a plugin
- 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 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
- 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)
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- How do I do a page break?
- Insert sometext after first h3 in content
- Thumbnail Image to go in the post aswell
- Is it possible to customize the post according to post format in single.php?
- Post type no single page
- Lock post editing to one user at a time – wp_check_post_lock
- Benefits to using semantic HTML in post content? [closed]
- Defined function isn’t showed on page
- the_content() Not Grabbing All Content
- Using AJAX and PHP to load next post object
- Hide parts of the post content after typing it’s name or searching it by category
- Changing wp_link_pages() to “Next Page” and “Previous Page” buttons?
- Making a wordpress page print friendly
- Posts and Pages w. private visibility don’t show up in existing content
- Automate post update for all posts?
- “Home” Page now only displaying the single latest post
- definining own teaser text for post
- How do I change the template specifically for single posts?
- How to get unmodified post content?
- I have inserted a post’s content in homepage.php by the post-id. The font isn’t matching with the theme. How do I change font of this content?
- Passing values via an Ajax querystring
- WP posts using index.php instead of single.php
- WP Ajax returning 0, can’t find action
- Single post shows post three times
- How do I check if a post is password protected?
- Ajax post doesnt call succes after got the response
- display multiple posts and posts content on a single URL
- Order result from ajax
- Colorbox not working on native WordPress gallery when gallery is loaded thru AJAX
- Dynamically load posts based on category
- Ajax the create and edit post form into lightbox and get results
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Get the category of post
- WordPress each user has each content for a page,how to do that?
- Add caption to thumbnails in content
- Adding div to WordPress page content
- Ajax – Post Categories and Load More
- Custom Single Post Type not referring to single-post-type.php File
- Adding editable content above posts
- Custom template for different post types
- Correcting the content width when sidebar is inactive?
- Thumbnail With Next/Prev Links Not Showing Next Post?
- WP Load post with ajax and apply isotope
- Pagination and Related Posts
- Single post page from static home not working
- Get post id on click of thumbnail
- Get current post’s child page?
- How can i show only 30% of the “the_content(“More…”)”?
- jquery: getting contents of #content field on post page
- Stripping tag from elements in post
- Wrap div-tag around posts in page
- What does WordPress mean by they have full rights to content [closed]
- wordpress pinboard theme [closed]
- Automatically search and replace link in content (pages/posts)?