2011-03-14 71 views
0

我有一個fancybox,你提交一個郵政編碼,以獲得您所在地區的渠道。這似乎工作在所有的瀏覽器,但IE瀏覽器,似乎無法找到是什麼導致它掛在IE中,任何建議?IE - 不會提交?

<script type="text/javascript"> 
$('document').ready(
    function() 
    { 
     //'http://fuseapi.viewerlink.tv/getProviders.asp?zip_code=' + $('#zip_look_up').val(), 
     $('#submit_zip').click(
      function(){ 
       $('#loading-indicator').show(); 
       $.get(
        '/sites/all/modules/channelfinder/channelfinder.php?zipcode=' + $('#zip_look_up').val(), 
        function(data) 
        { 
         $('#info_response').html('<div id="popup_questionContainer" style="padding:5px; width:auto;" class="clearfix">' + 
             '<div style="width: auto;">' + 
             '<div id="popup_dropDown"><select id="cableProv" name="cableProv">' + 
             '</select></div></div>' + 
             '<div id="popup_channelBox" style="display: none;"><span class="chanHdrBox">Fuse Channel</span>' + 
              '<div id="popup_channelResponse"></div>' + 
             '</div>' + 
             '<div id="popup_hdChannelBox" style="display: none; margin-left:10px;"><span class="chanHdrBox">HD Channel</span>' + 
              '<div id="popup_hdChannelResponse"></div>' + 
             '</div>' + 
             '</div></div>'); 

             var select = $('#cableProv'); 
             select.append("<option>Select your Service Provider</option>"); 
             $(data).find('PROVIDER').each(function() 
             { 
              var title = $(this).find('NAME').text(); 
              var channel = ($(this).find('HDCHANNEL').text() != '')? $(this).find('CHANNEL').text() + "," + $(this).find('HDCHANNEL').text(): $(this).find('CHANNEL').text() 
              select.append("<option value='" + channel + "'>"+title+"</option>"); 
             }); 
             select.append("<option value='339,1339'>DIRECTV</option>"); 

             $('#cableProv').change(
              function() 
              { 
               if($('#cableProv').attr("selectedIndex") != 0) 
               { 
                //console.log($('#cableProv').val().split(",")); 

                var channelNumber = $('#cableProv').val().split(",")[0]; 
                var hdChannelNumber = $('#cableProv').val().split(",")[1] === undefined ? 'N/A' : $('#cableProv').val().split(",")[1]; 

                $('#popup_channelBox').show(); 
                hdChannelNumber == 'N/A' ? $('#popup_hdChannelBox').hide() : $('#popup_hdChannelBox').show(); 

                if (channelNumber == '') { 
                 channelNumber = 'N/A'; 
                } 

                $('#popup_channelResponse').html('<h2>'+channelNumber+'</h2>'); 
                 $('#popup_hdChannelResponse').html('<h2>'+hdChannelNumber+'</h2>'); 

                if (channelNumber == 'N/A') { 
                 if (hdChannelNumber != 'N/A') { 
                  channelNumber = hdChannelNumber; 
                 } 
                } 
               } 
               else 
               { 
               } 
              }); 
         //console.log(data); 
         $('#loading-indicator').hide(); 
        }); 
       }); 
      }); 

+0

你試過用IE開發者工具調試? F12會帶來它們。 – 2011-03-14 18:57:04

+0

您是否對所有版本的IE(6/7/8)或僅有6/7有問題? – 2011-03-14 19:32:39

+0

我在IE8上測試,並沒有在那裏工作。 – Xtian 2011-03-14 19:49:43

回答

0

第一眼跳出的唯一的事情是對開頭的行缺少分號:

var channel = ($(this).find(... 

也許一個微妙的自動插入分號行爲混淆IE。

+0

@ Xtian:每行都應該有一個分號。 – 2011-03-14 19:19:52

0

$('document').ready$(document).ready或更短$(function() {