【问题标题】:CrossRider IE issueCrossRider IE 问题
【发布时间】:2014-05-05 18:24:51
【问题描述】:

您好,我正在创建一个简单的 crossrider 扩展,它从 php 获取数据并将其显示在扩展中。该代码在 Chrome 和 FireFox 中工作,但扩展程序根本不显示在 IE(v9 和 v11)中。下面是我使用的代码:

appAPI.ready(function($) {

  var sidebar = null;

        $.ajax({
                url:"http://localhost/getSupportLinks.php",
                type: 'POST',
                    data: {
                            "currentUrl":document.URL
                        },
                        dataType:'text',
                        success:function(result){

                         $(".crossrider-sidebar-"+appAPI.appInfo.id+"-container")
                             .remove();
                            if((result+'').length >0)
                            {   

                                //$(".crossrider-sidebar-"+appAPI.appInfo.id+"-container").remove();
                                //calculate height of toolbar base on number of icons
                                var sbrHgt = (((result.split("img src").length - 1)*55)+15) + 'px';

                                //initialize side bar
                                    sidebar = new appAPI.sidebar({
                                    position:'right', // Sidebar position (right, left, top, bottom) - currently only right is supported
                                    //url: '',
                                    html:result, // HTML for the sidebar (will be ignored if iframe URL is spesified as above)
                                    opacity:1.0, // Sidebar's opacity
                                    width:'120px', // Sidebar width (can be px or %)
                                    height:sbrHgt, // Sidebar height (can be px or %)
                                    //preloader:true, // Show spinning loader until content has loaded (apply only if url parameter is specified)
                                    sticky:true, // If true sidebar will be sticky and ignore user scroll,
                                                // false will make the sidebar to disapear if user scrolls down
                                                // default:true
                                    slide:150,
                                    theme:'default',
                                    openAction:['click', 'mouseover']
                                });

                                //show side
                                sidebar.show();
                            }   
                    },
                    error: function(xhr, status, error) {
                    //  var err = eval("(" + xhr.responseText + ")");
                        alert("Error  : "+err);
                    //  alert("Error status : "+status);
                    //  alert("Error message on PHP call : "+error);
                    }                       
            });             

});

代码之前可以正常显示,并且扩展程序在本周仅在 IE 上停止显示。我什至创建了一个单独的项目,它只显示一个简单的警报,甚至没有工作。我想知道的是:

  1. 还有其他人面临这个问题吗?
  2. 代码中是否有任何可能导致此问题的内容?

感谢您的帮助

【问题讨论】:

  • 这是您的实际代码吗?因为您的基本 URL 属性中有一个指向 localhost 而不是 localhost 的错字。
  • 哎呀抱歉。不,这只是我的一个错字。

标签: crossrider


【解决方案1】:

出于这个原因,请使用 Crossrider 提供的跨浏览器 appAPI.request.get 方法。将您的 $.ajax 转换为使用它很简单,但如果您需要帮助,请告诉我。

[披露:我是 Crossrider 的员工]

【讨论】:

  • 我使用了 appAPI.request.post,它似乎可以工作。感谢您为我指明正确的方向。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-02-28
  • 1970-01-01
  • 1970-01-01
  • 2010-10-14
  • 2016-03-01
相关资源
最近更新 更多