I have the problem that I don’t want to wait for extern scripts before my jquery load-function is triggered.
Can I do something against it?
code of load function:
$(function(){
// ... code here
});
UPDATE
Well defer works very well to ensure the functionality of my scripts.
But now I have huge Problems with the extern scripts functionality.
i.e. this twitter box does not load anymore
<script type="text/javasript" charset="utf-8" src="http://widgets.twimg.com/j/2/widget.js" defer="defer"></script>
<script type="text/javascript" defer="defer">
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 4,
interval: 30000,
width: 275,
height: 247,
theme: {
shell: {
background: '#8ec1da',
color: '#ffffff'
},
tweets: {
background: '#ffffff',
color: '#444444',
links: '#1985b5'
}
},
features: {
scrollbar: true,
loop: false,
live: true,
behavior: 'all'
}
}).render().setUser('xxxxxxxx').start();
</script>
as well facebook connect has problems, like Buttons in chrome do not work any more, and so on …
To avoid blocking the page rendering while downloading an external script file use
deferattribute.Xhtml sample:
More info: How exactly does <script defer="defer"> work?
Also, you can load the script files dynamically from Jquery using
getScript: