javascript error


(dutchmeat) #1

I’ve just enabled my javascript debugger because I was busy on some script, and it found a bug in the forum part(I don’t know about other parts of the website).

Error:

Line: 1282
Error: ‘document.forms.dstform’ is null or not an object

The linenumber of the error is dynamic, it’s about this piece of code;


<script type="text/javascript">
<!--
	var tzOffset = 1 + 0;
	var utcOffset = new Date().getTimezoneOffset() / 60;
	if (Math.abs(tzOffset + utcOffset) == 1)
	{
		// Dst offset is 1 so its changed
		document.forms.dstform.submit();
	}
//-->
</script>

Maybe you can fix it by adding an IF check;


<script type="text/javascript">
<!--
	var tzOffset = 1 + 0;
	var utcOffset = new Date().getTimezoneOffset() / 60;
	if (Math.abs(tzOffset + utcOffset) == 1)
	{
		//check if we've got a form to submit...
		if(document.forms.dstform != NULL)
		{
			// Dst offset is 1 so its changed
			document.forms.dstform.submit();
		}
	}
//-->
</script>


(hjyk126) #2

香港六合彩香港六合彩全面收集网上最强势的六合彩图库资料、六合彩开奖结果,让热爱六合彩开奖结果的彩民参考,并借此奉劝大家远离地下六合彩,本站仅为此搜索六合彩关键词做一份实验,在香港,六合彩是一家非牟利机构,所得六合彩盈余均拨捐慈善及社区团体,用以资助各项慈善公益计划,因此打击地下六合彩是我们共同的责任…香港六合彩香港六合彩香港六合彩


(9yco) #3

Buy the cheapest Nike dunks,Nike SB and Nike Dunk SB,9yco.com fine Nike Dunks store help you to save money!We guarantee the lowest prices on the world nike dunks shoes