I figured it out. Need to use echo in PHP instead of return.
<?php
$output = some_function();
echo $output;
?>
And the jQ:
success: function(data) {
doSomething(data);
}
More Related Contents:
- Hide/Show div on specific page with jquery
- Sending multipart/formdata with jQuery.ajax
- How to get a cross-origin resource sharing (CORS) post request working
- jQuery Ajax error handling, show custom exception messages
- Why is jQuery’s .ajax() method not sending my session cookie?
- Stop jQuery .load response from being cached
- jQuery ajax error function
- jQuery: serialize() form and other parameters
- How do I format a Microsoft JSON date?
- JQuery – Storing ajax response into global variable
- Submitting HTML form using Jquery AJAX
- Jquery Ajax Loading image
- jquery click doesn’t work on ajax generated content
- Mvc Jquery Ajax Post returns null
- Submit form in rails 3 in an ajax way (with jQuery)
- jQuery Ajax wait until all images are loaded
- How do I know if jQuery has an Ajax request pending?
- POST to server, receive PDF, deliver to user w/ jQuery
- jQuery’s .on() method combined with the submit event
- 403 Forbidden error when making an ajax Post request in Django framework
- How do I get the HTTP status code with jQuery?
- Reload table data in Django without refreshing the page
- Retrieving HTTP status code from loaded iframe with Javascript
- JQuery: post FormData AND csrf token together
- File upload using MVC 4 with Ajax
- What is the difference between XMLHttpRequest, jQuery.ajax, jQuery.post, jQuery.get
- Does Google crawl AJAX content? [closed]
- Select only specific dates in jQuery UI datepicker (date list comes from AJAX)
- JQuery Ajax is sending GET instead of POST
- Rails accepts_nested_attributes_for with f.fields_for and AJAX