Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internet Explorer 11 "Failed to open data:text/javascript;charset=utf-8," #1485

Closed
zardoz opened this issue May 5, 2015 · 8 comments
Closed

Comments

@zardoz
Copy link

zardoz commented May 5, 2015

Hi all,

we have a component in our Polymer project that is returning URL encoding, in the debugger it shows as:

Failed to open data:text/javascript;charset=utf-8,
        var SAGEITEMID%3B
        var JJFunction %3D new Object()%3B
        JJFunction.AJAX %3D new Object()%3B    
        JJFunction.BASKET %3D new Object()%3B
        JJFunction.BASKET.ITEM      %3D new Object()%3B
        JJFunction.BASKET.SUMMARY   %3D new Object()%3B
        JJFunction.BASKET.MASTER    %3D new Object()%3B
        JJFunction.SHOP             %3D new Object()%3B
        JJFunction.UI               %3D new Object()%3B
        JJFunction.GODADDY          %3D new Object()%3B
....

We are importing this file through a

<link import /> 

This files registers a polymer element name in the file itself:

<polymer-element name="proto-JJFUNCTION" >
    <template>
        <style>

        </style>


    </template>
    <script>
        var SAGEITEMID;
        var JJFunction = new Object();

        JJFunction.AJAX = new Object();

        JJFunction.BASKET = new Object();
        JJFunction.BASKET.ITEM      = new Object();
        JJFunction.BASKET.SUMMARY   = new Object();
        JJFunction.BASKET.MASTER    = new Object();
        JJFunction.SHOP             = new Object();
        JJFunction.UI               = new Object();

And includes this as a component as .

<proto-JJFUNCTION></proto-JJFUNCTION>

This works really well for all browsers apart from IE which seems to barf the encoding of the file....

I'm using master branch, some of the components are to version 0.6.1

Any suggestions?

@zardoz
Copy link
Author

zardoz commented May 7, 2015

This was not what I thought it was, simple project structure.

@zardoz zardoz closed this as completed May 7, 2015
@ldtung
Copy link

ldtung commented Jan 8, 2016

I also have the same issue.
Could you please share how to deal with this?

@nicholaswmin
Copy link

👍 Same here

@zardoz
Copy link
Author

zardoz commented Jan 20, 2016

OK, Yikes, this was a while ago. The first thing I would do is make sure that your template structures are not to complex (caveat we are running on Polymer 0.5, we are upgrading soon ), We found that on 0.5 deeply nested templates can cause issues, in-line as much as possible on those. We also provided id params on any custom elements, so the element:

<proto-JJFUNCTION id="a"></proto-JJFUNCTION>

So I'd start by looking at your templates, hence my cryptic previous comment. Make sure you are using the webcomponent tester and associated testing tools, found on the Polymer blog.

I'm very sorry I can't be more specific, as it was a while ago. I will reply back if I remember anymore

@redfellow
Copy link

Also started experiencing this on IE11

@redfellow
Copy link

redfellow commented Jan 31, 2017

Heh, I bumped into this again and to my surprise, I found myself in this issue.

For future reference, if I bump into myself for a third time:

var obj = {some, thing}; makes something in Polymer html encode the contents of the object on IE11.

Workaround: stay away from https://ariya.io/2013/02/es6-and-object-literal-property-value-shorthand even if you are running a shiv for IE11.

@rozzamozza
Copy link

Got the same issue on Polymer
"in-line as much as possible" kind of defeats the purpose of web components...

will checkout the web component tester...

@rozzamozza
Copy link

Found the related Polymer loading issue (for my issue at least).
The following works in Chrome..
_recalculate(){
But IN IE It needs to be stricter. I.e. this
_recalculate: function(){

It still renders poorly as UTF8 in IE though for other errors...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants