If your AJAX Url is conversion.php it will most likely point to yourdomain.com/conversion.php.
Is your file in that location?
Looks like not, and I guess you don’t have a 404.php, and in that case your request gets directed to your index.php, that’s why you get the contents of your homepage.
If your file is in your theme folder, you would have to change the URL to wp-content/themes/yourtheme/conversion.php
But the much easier and recommended way is to use WP built in AJAX functionality:
See this codex page for more informations:
http://codex.wordpress.org/Plugin_API/Action_Reference/wp_ajax_(action)
EDIT: Most posts on this topic are for AJAX on the WordPress backend but it’s possible to use it on the frontend as well.
Related Posts:
- ajaxurl not defined on front end
- Help adding image upload functionality to widget
- Admin-ajax.php appending a status code to ajax response
- Ajax in WordPress – path issue
- how to search users by ajax live search
- Ajax contact form widget plugin data not insert in database
- jquery & ajax sending data to php
- Ajax submit result opens in admin-ajax.php
- insert query on a custom table using ajax with jQuery plugin Jeditable
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Data not insert and update through ajax and jQuery in admin page?
- WP ajax requests not stacking?
- ajax working when function is on child theme but not in plugin page
- Ajax +wordpress onClick link redirect to new page and create html content
- Get cat parameter from admin-ajax
- Ajax on the Administration Side of plugin – returns 0
- Jquery php request is returning a weird result
- WordPress Ajax not returning Response
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Filterable posts using categories
- How to get values from Tinymce visual editor popup?
- WordPress function is not called and ajax return 0
- Ajax call not working with
- Page reload occurs before request finishes
- Why does WordPress add 0 (zero) to an Ajax response?
- Saving data-URI to media library
- Nonces can be reused multiple times? Bug / Security issue?
- Add content to widget title in admin area within the widget?
- Has anyone managed to integrate the wp_editor inside a widget?
- How to Add a .js file Only in one specific Page Dynamically to Head
- How to enable users to down-vote in this simple voting counter (that uses the post meta)?
- How to trap “Publish” button to check for meta box validation?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Possible to preset a widget’s contents via a plugin script?
- Use js script from one plugin in another plugin
- Plugin Settings not Saving on Ajax re-ordered table
- Install widget on plugin activation
- Timeout on Admin-Ajax?
- Is there a need to do apply_filter(‘widget_title’, $instance[‘title’]) or any other ‘widget_xxx’ filters?
- Comment `Reply` link doesn’t work if comments are loaded from ajax
- Dynamic content in a widget
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Can I individually style items in the backend widget list?
- Sidebar widget to show popular post not working?
- Add custom element ID depending where the widget place is, sidebar or footer
- wp_insert_post() is returning the correct post ID, no failure, but the post content does not get updated
- include wp-blog-header not working on MAMP
- Add a class to a dynamic sidebar’s wrapper
- How can I pass get_the_author_meta(‘user_email’) through the REST API?
- Woocommerce checkout update totals with datepicker
- Including the necessary functions for a custom ajax registration form
- Ajax load more button in Recent posts widget
- get post attachment using ajax
- Dashboard – get status and position of metaboxes and pass them to ajax method
- Display WordPress the_content() via data attributes
- adjust section according to country?
- javascript datatables in a plugin
- WordPress custom taxonomy check box to dropdown
- Why does my widget break other widgets?
- CSS not affecting widget output
- Plugin – Make sure jquery is loaded in my settings page plus my JS file
- should i be checking for jquery before enqueing it in a plugin
- Remove entire [$key] from array stored in custom field using Ajax – unset($array[$key]); not working
- jQuery instantly executes (a button click and css change) on load
- Create Widget or Enable Shortcodes in Sidebar
- making a plugin that moves other plugins wp_head actions to wp_footer
- Minimum Widget Width for Plugin Development
- Setting a JSON web token from a secondary api as a secure cookie on WordPress
- How do I get rid of my inclusion race-condition on wp_enqueue_script
- How to create a wordpress widget that dynamically changes according to the page
- AJAX call to admin-ajax.php by subscriber returns home page
- Ajax function is not working on WordPress
- How to localize data array in plugin’s option page
- AJAX request not routing through proxy
- Ajax request sends url rather than data
- Widget internal hooks and functions
- My plugin creates custom widgets, How can I programatically add them to existing sidebar widget areas?
- wc_get_template_part doesnt display the content [duplicate]
- GET request return value as error instead of success
- ajax stopped working when not logged in wordpress
- setTimeout not working in jquery
- ajax response strips multidimensional array and unable to decode
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- $_SESSION inside php function executed by AJAX
- Two same AJAX calls – one is working, other doesn’t
- Input field duplicates on form submit by jQuery
- WP Ajax on page load not working on bluehost but was working on Godaddy
- WordPress ajax not working in registration
- Downloading Generated XML File
- Script work on non logged in user but not work for logged in user?
- Can’t get query string in ajax call
- grouping my widgets wordpress
- Get fields of a widget
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- An adiitional function fires on my AJAX submit
- Fatal error: Call to a member function query() on a non-object in my ajaxpage
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- Jquery post responses 500 error after some time and lastly an 503 error
- Return custom product in ajax call loop
- Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?