Welcome Guest, Not a member yet? Register   Sign In
Jquery Post
#1

[eluser]vinoth15[/eluser]
Code:
function new_review(){
    $.post('restaurant_profile/get_dg_new_restaurant_review', {}, function callback(response) {
          alert(response);
    });
}

Hi i have a function that does an jquery ajax post to a controller function. The function outputs a simple string by an echo php function.

The function works fine if i don't have any uri segments after the controller name in intial page load.
ex. mysite.com/index.php/test_controller/

If for example the page was loaded with a index function and the uri segment contained the index function ex. mysite.com/index.php/test_controller/index

the response from the controller is all of the string output from the index function.
this is entire page html. I only want the text from the et_dg_new_restaurant_review function

Does anyone know how to fix this?
#2

[eluser]vinoth15[/eluser]
actually i figured it out.
the post url must be the full url

http://www.mystite.com/index.php/restaur...ant_review


thanks




Theme © iAndrew 2016 - Forum software by © MyBB