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
head.ready() doesn't fire in FF #62
Comments
few questions:
Thanks! |
Also having the same problem. Using v 0.8 and FF 3.6.13 head.ready fires too quickly. No error is returned, tough. If I fire a alert on "onsuccess" with .js("script.js",function(){alert("test")}); then the head.ready works. Maybe I should trigger a slight pause for FF-users?! |
Yes, I'm using the latest version of headjs. |
Public test page. |
noticed a really strange thing on the page. if you place both of the head calls inside a same SCRIPT element it works! investigating this now.. |
This is now fixed. Here is the commit: Thanks! |
Thank you! |
Now it works in FF, but not in Chrome.. am I doing something wrong? Code: <script src="/javascript/head.load.min.js" type="text/javascript"></script> <script type="text/javascript"> head.js('/javascript/signup_prompt.js'); </script>
|
confirming that it does not work in Chrome no longer |
ok. thanks! will check this out. |
Similar issue in chromium.
|
Updating to commit cf2e8972122116760f89 fixed this in both Firefox (3.6.13) and Chrome Beta (9.0.597.84) for me. Thanks for fixing it. |
load.js doesn't work in FF. |
@jonasboman can you clarify a bit? ideally with a live demo. |
Same url as before. http://demo.allstarsmedia.se/head.html |
I can confirm the test @jonasboman did doesn not work on FF 3.6.13 |
Not having FF 3.6 here but I'm assuming that this particular line
won't run since the DOM is not ready yet. You have to nest that call inside $(document).ready. I guess alert() will be fired on FF. |
It works both in IE and Chrome and on headjs.com it states that you can do this [code]head.ready(function() { |
Doing a callback resolved the issue
<script type="text/javascript">head.js("https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js","jquery.rater.js", function(){
$("p span").html("READY!").addClass("ready");
alert("ready to go!");
});
</script>
|
I'm experiencing an issue where head.ready doesn't fire in FF, it does in chrome and IE.
I've tried debugging, but my js-skills are not good enough yet to figure it out. However, I have discovered by console.logging "handlers" on head, that there is a difference between what it contains. In FF it contains and array with one function which is empty, where as in Chrome the function has an attribute (done = true).
I will gladly provide you with more information if only you tell me what you need.
Here's where I put the console.log:
(function(doc) {
var head = doc.documentElement,
ie = navigator.userAgent.toLowerCase().indexOf("msie") != -1,
ready = false, // is HEAD "ready"
queue = [], // if not -> defer execution
handlers = {}, // user functions waiting for events
scripts = {}, // loadable scripts in different states
}
In "head" I've put head.js(files); and somewhere in "body" I used head.ready()- which doesn't fire. I tried using the callback function from head.js and that works fine.
The text was updated successfully, but these errors were encountered: