Hi,
I’m using MooTools ([COLOR=#0000ff]www.mootools.net[/COLOR]) javascript library for a drop
down navigation in my website. I also use SWFObject to insert Flash
elements throughout my page.
This, so far, works fine.
But the moment I click on a link in the navigation (which directs to a
new page), I get an error message appear just before the page url changes.
I don’t understand why this happens but I can’t put the site live
until I resolve the issue?
The error is “Object doesn’t support this method or property”?
Here is a link to the online version, you can see (if your internet explorer is setup to show all errors) the problem when you use the side navigation to click around other pages…
[COLOR=#810081]http://www.storm-media.co.uk/storm-media.co.uk/[/COLOR]
Firefox and Safari has the problem but doesn’t stop the page from changing to the new page, whereas my IE is setup to stop and show all errors.
The problem is something to do with the SWFObject method
swfobject.embedSWF("")
and someone mentioned that this method uses it’s own internal DomContentLoaded event and that the swfobject.embed() method is conflicting with the MooTools DomContentLoaded event.
I’ve tried moving the SWFObject code under all other scripts but that hasn’t worked?
Any help would be appreciated!
Kind regards,
Mark
My code is as follows (I’ve removed irrelevant code)…
<script src="/Assets/Scripts/domready.js" type="text/javascript"></
script>
<script src="/Assets/Scripts/contact.js" type="text/javascript"></
script>
<script src="/Assets/Scripts/latest.js" type="text/javascript"></
script>
<script src="/Assets/Scripts/mootools.js" type="text/javascript"></
script>
<script src="/Assets/Scripts/swfobject.js" type="text/javascript"></
script>
<script src="/Assets/Scripts/swfobject-settings.js" type="text/
javascript"></script>
<script type="text/javascript">
window.addEvent('domready', function()
{
// Create each slide object
var whatWeDo = new Fx.Slide('ddWhat');
var whoWeDoItFor = new Fx.Slide('ddWho');
var archive = new Fx.Slide('ddArchive');
// Hide the drop down menus
whatWeDo.hide();
whoWeDoItFor.hide();
archive.hide();
// Add extra spacing to drop down lists
$('ddWhat').style.paddingBottom = "3px";
$('ddWho').style.paddingBottom = "3px";
$('ddArchive').style.paddingBottom = "3px";
// Add a cursor styles to the drop down headers
$('toggleWhat').style.cursor = "pointer";
$('toggleWho').style.cursor = "pointer";
$('toggleArchive').style.cursor = "pointer";
// Add a mouse over/out styles to the drop down headers
$('toggleWhat').onmouseover = function(){ this.style.color =
"#E31F26"; };
$('toggleWhat').onmouseout = function(){ this.style.color =
"#4c655b"; };
$('toggleWho').onmouseover = function(){ this.style.color =
"#E31F26"; };
$('toggleWho').onmouseout = function(){ this.style.color =
"#4c655b"; };
$('toggleArchive').onmouseover = function(){ this.style.color =
"#E31F26"; };
$('toggleArchive').onmouseout = function(){ this.style.color =
"#4c655b"; };
// Add event listeners
$('toggleWhat').addEvent('click', function(e){ e = new Event(e);
whatWeDo.toggle(); e.stop(); });
$('toggleWho').addEvent('click', function(e){ e = new Event(e);
whoWeDoItFor.toggle(); e.stop(); });
$('toggleArchive').addEvent('click', function(e){ e = new Event(e);
archive.toggle(); e.stop(); });
});
</script>
<link rel="stylesheet" type="text/css" href="/Assets/Styles/
Import.css" media="screen">
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="/Assets/Styles/IE6.css"
media="screen">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="/Assets/Styles/IE7.css"
media="screen">
<![endif]-->
<title>storm</title>
</head>
<body>
<ul id="menu">
<li><span id="homeButton"><a href="/index.html"><img src="/Assets/
Images/Title-Home.gif" alt="home" /></a></span></li>
<li><span><img src="/Assets/Images/Title-LookAround.gif" alt="look
around" /></span></li>
<li><span><a id="toggleWhat" name="toggle">what we do /</a></span>
<ul id="ddWhat">
<li><a href="/WhatWeDo/marketing-comms.html">marketing comms</a></
li>
<li><a href="/WhatWeDo/creative-design.html">creative design</a></
li>
<li><a href="/WhatWeDo/digital-media.html">digital media</a></li>
<li><a href="/WhatWeDo/publishing.html">publishing</a></li>
</ul>
</li>
<li class="wwdif"><span><a id="toggleWho" name="toggle">who we do it
for /</a></span>
<ul id="ddWho">
<li><a href="/WhoWeDoItFor/public-sector.html">public sector</a></
li>
<li><a href="/WhoWeDoItFor/private-sector.html">private sector</
a></li>
</ul>
</li>
<li class="hww"><span><a href="/HowWeWork/index.html">how we work /</
a></span></li>
<li class="thelatest"><span><a href="/OurWork/index.html">the
latest /</a></span>
<ul class="archive">
<li><span><a id="toggleArchive" name="toggle">project archive</a></
span>
<ul id="ddArchive">
<li><span>public sector - c2g/c2b</span>
<ul>
<li><a href="/Archive/Public/schools-colleges.html">schools /
colleges</a></li>
<li><a href="/Archive/Public/LSC-partnerships.html">LSC
partnerships</a></li>
<li><a href="/Archive/Public/arts-council.html">arts council</
a></li>
<li><a href="/Archive/Public/family-information.html">family
information</a></li>
<li><a href="/Archive/Public/leisure-and-tourism.html">leisure
and tourism</a></li>
<li><a href="/Archive/Public/corporate-plans.html">corporate
plans</a></li>
<li><a href="/Archive/Public/council-business-
forum.html">council business forum</a></li>
<li><a href="/Archive/Public/connexions.html">connexions</a></
li>
<li><a href="/Archive/Public/internal-comms.html">internal
comms</a></li>
<li><a href="/Archive/Public/identity-
branding.html">identity / branding</a></li>
<li><a href="/Archive/Public/internet-digital-
media.html">internet / digital media</a></li>
<li><a href="/Archive/Public/video-production.html">video
production</a></li>
<li><a href="/Archive/Public/civic-publications.html">civic
publications</a></li>
<li><a href="/Archive/Public/conceptual.html">conceptual</a></
li>
</ul>
</li>
<li><span>private sector - b2b/b2c</span>
<ul>
<li><a href="/Archive/Private/identity-
branding.html">identity / branding</a></li>
<li><a href="/Archive/Private/creative-design.html">creative
design</a></li>
<li><a href="/Archive/Private/internet-digital-
media.html">internet / digital media</a></li>
<li><a href="/Archive/Private/publishing.html">publishing</a></
li>
<li><a href="/Archive/Private/marketing-comms.html">marketing
comms</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="wwu"><span><a href="/WorkWithUs/index.html">work with us/
</a></span></li>
</ul>
</body>
</html>