Welcome to WebmasterWorld Guest from 54.242.83.7

Forum Moderators: open

Message Too Old, No Replies

Problem with Script that Loads Last

     
3:13 pm on Nov 1, 2013 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 4, 2004
posts: 456
votes: 0


On one site everything works fine when the javascript script loads just before the closing head tag.

It does not work on another site with a theme that forces a link tag (to load the favicon) appears just before the closing tag.

Could a link tag prevent the javascript from loading properly or should I be looking elsewhere for the reason the script is not working?
3:28 pm on Nov 1, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts: 4988
votes: 12


What is the JavaScript doing? Is it looking for the link tag? The favicon? Placement of the script file can certainly break the script if it has dependencies that don't exist yet.
4:00 pm on Nov 1, 2013 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 4, 2004
posts: 456
votes: 0


Fotiman,

Thank you for your response.

I'm not sure. Without the link load it works, with it the thing breaks.

<script src="http://example.com/js/balloons.js"></script>
<link rel="shortcut icon" href="http://example.com/favicon.png" />
</head>
4:06 pm on Nov 1, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts: 4988
votes: 12


There's nothing obvious there. Would need to see the contents of balloons.js.
4:59 pm on Nov 1, 2013 (gmt 0)

Preferred Member

10+ Year Member

joined:Jan 4, 2004
posts: 456
votes: 0


After a Duh! moment I added the link load to the working site. It works fine, so it must be another issue. Before posting the code I'm going to dig a little deeper on the site's html.

Thanks for your help, Fotiman.