0

次のコードは、FF、opera、chrome では問題なく動作しますが、IE では失敗します。

function get_modelo(modelo) {
        var selState = modelo;
        alert (selState);
        console.log(selState);
        $.ajax({    
            url: "site/ajax_call", //The url where the server req would we made.
            async: false, 
            type: "POST", //The type which you want to use: GET/POST
            data: "state="+selState, //The variables which are going.
            dataType: "HTML", //Return data type (what we expect).

            //This is the function which will be called if ajax call is successful.
            success: function(data) {
                //data is the html of the page where the request is made.
                $('#city').html(data);
            }
        })
    }

問題が理解できません。

4

2 に答える 2

3

IE の console.log が機能しないか、問題が発生します。

こちらをご覧ください: IE8 の console.log はどうなりましたか?

そしてここ: IEでのconsole.logステートメントのテスト

そしてここ: http://paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/

または単にGoogle検索IEコンソールログ

コード内の他のすべてが正常に機能するように見えます。

于 2013-01-22T01:33:41.023 に答える
0

これを試して。以下はIE8で動作します:P

$.ajax({    
        url: "site/ajax_call", //The url where the server req would we made.
        async: false, 
        type: "POST", //The type which you want to use: GET/POST
        data: { state: selState }, //The variables which are going.
        dataType: "html", //Return data type (what we expect).

        //This is the function which will be called if ajax call is successful.
        success: function(data) {
            var newDiv = $('<div></div>');
            newDiv.html(data);
            newDiv.appendTo("#city");
        }
    });
于 2013-01-22T06:17:11.200 に答える