That's not actually a DD script. It's a weather widget from MetService. They do use some DD code though, so the credit should remain. The error occurs in the http://www.metservice.com/assets/js/ms.widget.js file on the line specified (179) as it's trying to convert an undefined object/variable to upper case.
This error occurs in other browsers (IE 9, Opera, Chrome, probably others). IE 8 is just more aggressive in reporting it. The widgets are working in IE 8 and those others. They are the weather reports for Hastings and Napier.
The problem arises because mootools (which is also used on the page) isn't 100% compatible with the mets weather widget. Because of the error, even in those browsers which render the widget, you lose the orange "Warnings in force" link bar of the widgets.
You could put the widget on a separate page and have it shown on the main page via an iframe, you would lose the error, get back the "Warnings in force", but the disclaimer would not display properly (that can be worked out though). Of course you could get rid of mootools from the page, but that seems unlikely.
For iframe, put this in the head of the page (highlighted as indicated):
Code:
. . . right: 10px;
z-index: 15;
display: none;
}
-->
</style>
<link rel="stylesheet" href="http://www.metservice.com/assets/css/MSwidget.css" type="text/css">
<style type="text/css">
.MSdisclaimerContainer {
width: 500px !important;
}
.MSdisclaimerContainer .MSdisclaimerInner {
border-radius: 15px !important;
}
</style>
<script type="text/javascript" src="/media/system/js/mootools.js"></script>
<script type="text/javascript" src="/plugins/system/jceutili . . .
On the page in the body replace:
Code:
<center>
<script type="text/javascript" src="http://www.metservice.com/assets/js/ms.widget.js"><!--
/***********************************************
* Dynamic Countdown script- Dynamic Drive
(http://www.dynamicdrive.com)
* This notice MUST stay intact for
legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
// --></script>
<script type="text/javascript"><!--
new
METS.Widget({id: 'MSwidgetOne',
host: 'www.metservice.com',
city: 'Hastings',
type: 'two'});
new
METS.Widget({id: 'MSwidgetTwo',
host: 'www.metservice.com',
city: 'Napier',
type: 'two'});
// --></script>
<div class="cleanslate MSwidget" id="MSwidgetOne"></div>
<div class="cleanslate MSwidget" id="MSwidgetTwo"></div>
</center>
with:
Code:
<script type="text/javascript">
(function(){
function onloadfunc(){
document.getElementById('metsframe').src = 'mets.htm';
}
if (window.addEventListener){
window.addEventListener('load', onloadfunc, false);
}
else if (window.attachEvent){
window.attachEvent('onload', onloadfunc);
}
})();
</script>
<iframe id="metsframe" src="about:blank" style="width: 238px; height: 262px; border-width: 0; overflow: hidden; margin: 0 auto; display: block;" frameborder="0"></iframe>
Create mets.htm in the same folder and put this code in it:
Code:
<!DOCTYPE html>
<html>
<head>
<title>Met Service Westher Widget</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
html, body {
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
<script type="text/javascript">
if(self !== parent){
jQuery.fn.jquery = '1.5.1';
var $ = jQuery.noConflict(true), pds, timer;
$('head').append('<style type="text/css">.MSdisclaimerContainer {display: none !important;}<\/style>');
$('.MSdisclaimer').live('mouseenter', function(e){
clearTimeout(timer);
if(pds){pds.remove();}
var $ds =$(this), w = $ds.width(), h = $ds.height(), o = $ds.offset(), po = $(parent.document.body).find('#metsframe').offset();
pds = $('.MSdisclaimerContainer').clone(true).css({display: 'none', position: 'absolute', top: o.top + po.top + h, left: o.left + po.left + w, width: 238, height: 'auto'});
$(parent.document.body).append(pds);
pds.fadeIn('slow');
pds.unbind().hover(function(){clearTimeout(timer);}, function(){timer = setTimeout(function(){pds.remove();}, 1000);});
}).live('mouseleave', function(){
timer = setTimeout(function(){pds.remove();}, 1000);
});
}
</script>
</head>
<body>
<script type="text/javascript" src="http://www.metservice.com/assets/js/ms.widget.js">
// ms.widget.js contains and sometimes uses:
/***********************************************
* Step Carousel Viewer script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript">
new METS.Widget({id: 'MSwidgetOne',
host: 'www.metservice.com',
city: 'Hastings',
type: 'two'});
new METS.Widget({id: 'MSwidgetTwo',
host: 'www.metservice.com',
city: 'Napier',
type: 'two'});
</script>
<div class="cleanslate MSwidget" id="MSwidgetOne"></div>
<div class="cleanslate MSwidget" id="MSwidgetTwo"></div>
</body>
</html>
Some tweaking may be required/desired. The browser cache may need to be cleared and/or the page refreshed to see changes.
One other solution would be to suppress error reporting:
Code:
<center>
<script type="text/javascript" src="http://www.metservice.com/assets/js/ms.widget.js"><!--
/***********************************************
* Dynamic Countdown script- Dynamic Drive
(http://www.dynamicdrive.com)
* This notice MUST stay intact for
legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
// --></script>
<script type="text/javascript"><!--
window.onerror = function(){return true;};
new
METS.Widget({id: 'MSwidgetOne',
host: 'www.metservice.com',
city: 'Hastings',
type: 'two'});
new
METS.Widget({id: 'MSwidgetTwo',
host: 'www.metservice.com',
city: 'Napier',
type: 'two'});
// --></script>
<div class="cleanslate MSwidget" id="MSwidgetOne"></div>
<div class="cleanslate MSwidget" id="MSwidgetTwo"></div>
</center>
But you still miss out on the "Warnings in force".
In fact, if you use the iframe method, or get rid of mootools, you could even use the type: 'one' widget and it would work.
Bookmarks