tags:

views:

14

answers:

1

Hello,

I am using :

function ajax(u,s,t) {
jQuery.ajax({type: "POST", url: u, data: query, success: function(msg) { if(t==':eval') eval(msg); else document.getElementById(t).innerHTML=msg; } });
}

This works fine with FF but with IE it doesn't work is there somthing wrong I did?

Thanks in advance.

A: 

If you are using jQuery why are you still manipulating the DOM manually? Try cleaning your code. Also there are strange things in your success callback. What is this t variable? Once you are using it as element ID and also testing it's value for eval. By the way you should avoid using eval.

jQuery.ajax({
    type: 'POST',
    url: u,
    data: query,
    success: function(msg) {
        // This success callback needs revision
        if(t == ':eval') {
            // ??????
            eval(msg);
        }
        else {
            jQuery('#' + t).html(msg);
        }
    } 
});

I would probably replace all this with the .load() function:

$('#' + t).load(u, query);
Darin Dimitrov
Thanks a lot Darin Dimitrov , it works fine with me :)
Neveen