Welcome Guest, Not a member yet? Register   Sign In
jquery + codeigniter problem
#1

[eluser]obay[/eluser]
Hi all,

I'm trying to use the
Code:
$.post()
of JQuery but it's not retrieving the values. This used to work when I didn't use CI.. (this is my first time using MVC for PHP). I suspect that it's because of the MVC structure that is causing the problem. Can you take a while to look at my code?

my controller:
Code:
function bug_add($review_id) {
    echo '<?xml version="1.0" encoding="UTF-8" ?>';
    echo '<response>';
        echo '<bug>data</bug>';
    echo '</response>';
}

my view:
Code:
$("#button_add").click(function(e) {
    $.post(
        "review/bug_add/&lt;?=$review_id?&gt;",
        {
            //some values here
        },
        function(xml){
            $(xml).find("bug").each(function() {
                alert( $(this).text() ); //this never gets called
            });
        },
        "xml"
    );
});

If I remove the "xml" from the $.post(), the data are retrieved.

What do you think is wrong?

Thanks for your time Smile


Messages In This Thread
jquery + codeigniter problem - by El Forum - 09-15-2009, 04:03 AM
jquery + codeigniter problem - by El Forum - 09-15-2009, 05:49 AM
jquery + codeigniter problem - by El Forum - 09-15-2009, 07:49 AM
jquery + codeigniter problem - by El Forum - 09-15-2009, 12:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB