Question

Hello I am creating a simple crossrider extension that gets data from a php and displays it in the extension. THe code work in Chrome and FireFox, but the extension does not show up at all in IE (v9 and v11). Below Is the code i use:

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

});

The code was displaying properly before and the extension stopped showing up as of this week on IE alone. I even created a separate project that just shows a simple alert and even that did not work. What I want to know is:

  1. Is there anyone else facing this issue?
  2. Is there anything potentially in the code that could be causing this?

Thank you for you help

Was it helpful?

Solution

Use the cross browser appAPI.request.get method provided by Crossrider for this very reason. It's simple to convert your $.ajax to use it, but if you need a hand, let me know.

[Disclosure: I am a Crossrider employee]

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top