我有一个fancybox,您可以在其中提交邮政编码,以便获取您所在地区的频道。这似乎适用于所有浏览器,但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 :(得分:0)
乍看之下唯一突然出现的就是线上缺少分号:
var channel = ($(this).find( ...
也许微妙的自动分号插入行为会让IE感到困惑。
答案 1 :(得分:0)
$('document').ready
应为$(document).ready
或更短$(function() {