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

steal 3.2.1: exception with steal.loaded property set in IE8/IE9 #49

Closed
skhilko opened this issue Oct 19, 2011 · 5 comments
Closed

steal 3.2.1: exception with steal.loaded property set in IE8/IE9 #49

skhilko opened this issue Oct 19, 2011 · 5 comments

Comments

@skhilko
Copy link

skhilko commented Oct 19, 2011

I'm using jmvc 3.2.1 and attempting to reduce page flickering during its initialization. So I've added production.css to the head element and provided loaded property in steal global var:

<link rel="stylesheet" type="text/css" href="production.css"/>
<script type="text/javascript">
var steal = {
app: "myapp",
env: "production",
loaded: ["myapp/production.css"]
};
</script>
<script type='text/javascript' src='../steal/steal.js'></script>

I'm getting an exception in IE browsers and production.css is loaded by steal for the second time.
Other browsers work fine and production.css is requested only once in the head.

After some research I've found why IE is failing..
There is a section of a special IE treatment in steal.js
it starts with if (support.interactive) { where the function below
function(name){ var src = steals[name].options.src, interactive = getCachedInteractiveScript(), interactiveSrc = interactive.src; interactives[src] = interactives[interactiveSrc]; interactives[interactiveSrc] = null; }
is being attached on steal.loaded function.
This particular function fails on var src = steals[name].options.src line because steals["myapp/production.css"] is undefined here.
Other browsers have no issue here because an original steal.loaded is called directly.

@justinbmeyer
Copy link
Contributor

thanks. I will take a look at it.

@lastzero
Copy link

Could this be related to #33 ? Read the comment at the bottom.

@skhilko
Copy link
Author

skhilko commented Oct 19, 2011

Why do you think so? Looks different to me. Here I'm trying to tell steal that a file has been already loaded outside.

@skhilko skhilko closed this as completed Oct 19, 2011
@skhilko skhilko reopened this Oct 19, 2011
@skhilko
Copy link
Author

skhilko commented Oct 19, 2011

Oh, tried to put a comment but closed the ticket.=) Reopening..

@fabio-scala
Copy link

I'm getting SCRIPT5007: Unable to get value of the property 'src': object is null or undefined in IE9 after pulling from git.
Line: https://github.com/jupiterjs/steal/blob/master/steal.js#L2045

Going home now.. Only work thu/fri so I won't be able to look deeper into it. Thought I would post this.. If you can't reproduce it you can ignore this comment of course and I'll have to dig deeper next week.

Anyway, have a nice weekend guys..

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

4 participants