IE - 不会提交?

发布于 2024-10-22 09:25:23 字数 4818 浏览 1 评论 0原文

我有一个 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();
                    }); 
                });
            });

I have a fancybox where you submit a zip code in order to get channels in your area. This seems to work in all browsers but IE, can't seem to find what is causing it to get hung up in IE, any suggestions??

<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();
                    }); 
                });
            });

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

天涯沦落人 2024-10-29 09:25:23

乍一看唯一跳出来的是开头行中缺少分号:

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

也许微妙的自动分号插入行为使 IE 感到困惑。

The only thing that jumps out at first glance is a missing semicolon on the line that begins:

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

Perhaps a subtle automatic semicolon insertion behavior is confusing IE.

甜警司 2024-10-29 09:25:23

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

$('document').ready should be $(document).ready or shorter $(function() {

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文