Question

I need to prioritize scripts so jQuery, Cufon, and my .js files come before Twitter does. I've tried defer="defer" as well as placing scripts in the bottom in the order I want them to execute but all these methods aren't working.

I don't want to modify Twitter's files either. Anything I can do?

Was it helpful?

Solution

Have your script create the html to have the Twitter script downloaded. That way it will be loaded and executed after your script, which comes after jQuery and Cufon.

OTHER TIPS

Remember that defer is not standard and only supported by IE. Also, give more information. "aren't working" isn't a lot to go by. The order of compiling and executing Javascript is well define, so if you're doing things right they should execute in the right order. However, remember that a syntax error in any block will forbid the entire block from executing, so make sure something you think is running earlier is actually running at all.

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