2016-05-15 6 views
0

私はIEの問題を遭遇しました。私は説明を見つけることができません。私はクロムとFirefoxで警告を発するこのコードを持っていますが、それはIEではありません。私はGetDictBySubtitle()に電話していない。 IEで奇妙な問題が発生する

<?php 
header('Content-type: text/html; charset=UTF-8'); 
?> 

<!doctype html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=Edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <meta name="description" content=""> 
    <meta name="author" content=""> 

    <title>Something</title> 

    <link rel="stylesheet" href="../css/bootstrap.css" type="text/css"> 
    <link href="../css/dashboard.css" rel="stylesheet"/> 

    <script> 

    function GetDictBySubtitle() { 

     var userid = "000000000027"; 
     var subid = "6317450"; 
     postData = {"userid":userid, "subtitleid":subid};    
      $.ajax({ 
       url: "/cgi-bin/get_movie_dictionary.py", 
       type: "post", 
       datatype:"json", 
       async : true, 
       data: {postData}, 
       success: function(response){ 
        alert(response); 
       } 
      }); 

    } 

    function GetAccountData() { 

     var userid = "000000000027"; 
     alert(userid); 

    } 

</script> 

</head> 
<body> 

<script> 
    window.onload = function() { 
     GetAccountData(); 
    } 
</script> 

AN ALERT SHOULD BE DISPLAYED 

</body> 

    <script src="../js/jquery.js"></script> 
    <script src="../js/jquery-ui.min.js"></script> 
    <script src="../js/bootstrap.min.js"></script> 
    <script src="../js/light-bootstrap-dashboard.js"></script> 


</html> 

は、私はまた、リクエストに cache: falseを追加しましたが、私は、IEからすべてを削除し、それを再起動すると、アラートがまだ暗闇の中でどこかに潜んされているので、それは、キャッシュの問題ではありません。

注:IEでページをデバッグするとき、window.onloadブロックにGetAccountData() is undefinedエラーが発生します。

私はそれは私が殺すために時間を持っている場合、私はいつもマイクロソフトに数えることができるように素晴らしいIE 10、クロム50、Firefoxの45

を使用しています。

+0

IEでポップアップを無効にしましたか? – Marcus

+0

.onloadブロックにアラートを入れると、正常に表示されます。 – erdomester

+0

'window.onload = GetAccountData;だけを試してください。 – Marcus

答えて

1

変更

data: {postData}, 

再び

data: postData, 

とテストに。

なぜですか?

postDataobjectです。

{postData}が間違っています。この場合、Internet Explorerはエラーを検出し、実行をブロックします。

関連する問題