View Single Post
Old 11-19-2012, 09:04 PM   #1
Join Date: Nov 2012
Posts: 15
Default Spry Menu Not Displaying External Javascripts

Hi all,

Sorry for sounding daft, but I'm pretty new to coding.

I wish to place the few javascript functions that I use on my website into one external file. I've read this is better practice as I initially placed them all on each webpage.

The external javascript file looks like this:

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-20927289-1']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

<script type="text/javascript" src=""></script>

<script type="text/javascript" src="jquery.magnifier.js">

* jQuery Image Magnify- (c) Dynamic Drive DHTML code library (
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at for this script and 100s more


<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});

<!-- Begin Web-Stat code 2.0 http -->
<script type="text/javascript" src=",3"></script>
<!-- End Web-Stat code v 2.0 -->

I just cut and pasted each snippet of javascript out of the page and placed it in a separate file which I named javascript.js

As you can imagine, there are syntax errors flying up with the code.

I placed this snippet on the main webpage in order to link to the external js code:

<script type="text/javascript" src="javascript.js"></script>

The spry drop down menus ceased working so for now I have pasted the two relevant spry scripts back on to the page.

Ultimately, I wish to have all the scripts on their own external page.

My website is

Any help would be greatly appreciated by this newbie.
MikeyRitz is offline   Reply With Quote