racky
racky

Reputation: 257

Jquery ajax ($.ajax) not working on chrome. please help

I need a little help to figure out why the following code does not work on google chrome 5/windows xp. It works well on all other browsers (IE, FF, Safri, Opera etc). Can someone shed some light around this?


    /* AJAX Request */
jq("#a-post-request").unbind("click").bind("click", function(e){ 
    //jq("#loading").css({"display":"block"});
    jq.ajax({
        url: "search_data_table.html",
        type: "get",
        cache: false,
        error: function(){alert ("No data found for your search.");},
        success: function(data){
            jq("#search-results-table tbody").empty().append(data);
            jq("#search-results").css({"display":"block"});
            jq("#search-results-table").trigger("update"); // this one is for the table sorter plugin
            // set sorting column and direction, this will sort on the first column.
            var sorting = [[0,0]];// this one is for the table sorter plugin
            // sort on the first column .
            jq("#search-results-table").trigger("sorton",[sorting]);// this one is for the table sorter plugin
            e.preventDefault();
        }
    });
});

Many thanks, Racky

Upvotes: 1

Views: 4902

Answers (3)

NAC
NAC

Reputation: 135

Change type:get to type:post.

Upvotes: 0

Jesse
Jesse

Reputation: 10466

Hey, so a little clue to the error would be to look at the developer tools page, and see if you're getting any errors with the XHTTPRequest.

My guess though, as I've run into this before, is that chrome is running into security issues, and not allowing the request to work.

As for how to fix it, it's going to depend on the problem. Let us know what you find in the developer tools!

Upvotes: 0

jAndy
jAndy

Reputation: 235962

The only thing I notice here is a missing

dataType: "html"

or whatever. Else, see comment.

Upvotes: 1

Related Questions