2

working in popup extension with crossrider and it's working fine in FF and GC, but in IE it passes this block of code without execution (tried to but alert messages before and after and all fired)

...    
appAPI.request.get({ url: WebServiceUrl + encodeURIComponent(searchWord),
                        onSuccess: function(entryString) {
                            var entry = JSON.parse(entryString);
                            if(entry.SearchResults == "NoResult")
                            {           
                                EmptySearch();
                                def.innerHTML = noResultMessage;
                            }
                            else
                            {   
                                DisplayData(searchWord.toString(), entry);
                            }
                        },
                        onFailure: function(httpCode) {
                             EmptySearch();
                             def.innerHTML = ConnectionErrorMessage;
                        },
                        contentType: 'application/json'
                        });

for more details : working in Win 7 , IE 11

HokaHelal
  • 1,568
  • 2
  • 15
  • 21
  • [appAPI.request.get](http://docs.crossrider.com/#!/api/appAPI.request-method-get) is an async method and passes control to the next statement before completing. Since you get the "after" message, the request is sent and what you're probably experiencing is the callback not being fired. There isn't enough information here to determine the cause (e.g. server not responding) and hence to properly assist, please provide the WebServiceUrl and a sample searchWord. If you wish to keep this private, then provide the extension id and I can take a look. [**Disclosure**: I am a Crossrider employee] – Shlomo Feb 04 '15 at 13:45
  • the callback is fired right in FF and GC, so it's not a server problem , anyway Id=70700 – HokaHelal Feb 04 '15 at 13:51
  • I've seen scenarios in the past that are similar to this whereby IE had different expectations in its communication with the server. I'm not saying that is the issue here, just that it's one of many. I'm going offline now, but I will look into this tomorrow. – Shlomo Feb 04 '15 at 17:21

1 Answers1

1

Thank you for the additional information you provided.

Looking at your extension popup code, I can see you are using jQuery to update the src attribute of img tags in your HTML. Whilst this works in other browsers, there is a known issue with doing this in Internet Explorer.

To work around the issue, please use the method described in the warning note in the docs for appAPI.browserAction.setPopup, i.e. use a placeholder element for the image (e.g. a div) in the HTML portion of the popup page and then dynamically add the image to it.

Shlomo
  • 3,763
  • 11
  • 16