Link to home
Start Free TrialLog in
Avatar of Shopies
Shopies

asked on

Ugly JS error

Hi,
I'm building up my own script and I use some JS codes. I didn't do those codes since I don't write JS. It gives me the snippeted two errors. I tried to get to those errors but I couldn't. Could anyone help me please?!!
Line:40
Char:2
Code:0
Error:'document.getElementById(...)' is null or not an object
URL:http://localhost/phpmyadmin/
 
Line:22
Char:2
Code:0
Error:'null' is null or not an object
URL:http://localhost/phpmyadmin/

Open in new window

Avatar of MMDeveloper
MMDeveloper
Flag of United States of America image

the 2nd one is probably a result of the first one... wha thte first one means that on line 40, a "document.getElementById()" call is made, which references an ID of a page element that does not exist during that script's runtime and within the scope of said script. Can you post the HTML of this page (including the jS)?
You need to give us some more context. Is this error occuring in a PhpMyAdmin installation? You might want to check if you are running the latest version then.

The first error usualy means the js is trying to get to some HTML that doesn't exist (yet).
Avatar of Shopies
Shopies

ASKER

This is a snippet of the HTML page:
<html xmlns="http://www.w3.org/1999/xhtml" DIR="RTL">
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>Shopies - ZawagCP</title>
 
<link rel=stylesheet href="css/admin_bar.css">
<link rel=stylesheet href="css/slide_menu.css">
<link rel=stylesheet href="css/style.css">
<link rel=stylesheet href="css/round.css">
<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="css/ddtabmenu.css" />
 
<script type="text/javascript" src="jscripts/jquery-latest.js"></script> 
<script type="text/javascript" src="jscripts/thickbox.js"></script>
<script type="text/javascript" src="jscripts/toggel_elements.js"></script>
<script type="text/javascript" src="jscripts/admin_bar.js"></script>
<script type="text/javascript" src="jscripts/slide_menu.js"></script>
<script type="text/javascript" src="jscripts/checkbox.js"></script>
<script type="text/javascript" src="jscripts/prototype.js"></script>
<script type="text/javascript" src="jscripts/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="jscripts/ddtabmenu.js"></script>
<script type="text/javascript" src="jscripts/mhover.js"></script>
<script type="text/javascript" src="components/wysiwyg/scripts/innovaeditor.js"></script>
<script type="text/javascript" src="jscripts/checkall.js"></script>	
<script type="text/javascript">
	$(function(){
 
		$("#checkbox").checkbox({checked: "./images/asterisk_yellow.jpg", unchecked: "./images/asterisk_gray.jpg"});
		$("#cssCheckbox").cssCheckbox();
 
	});
</script>
 
	<script type="text/javascript">
	//SYNTAX: ddtabmenu.definemenu("tab_menu_id", integer OR "auto")
	ddtabmenu.definemenu("ddtabs1", 0) //initialize Tab Menu #1 with 1st tab selected
	</script>
 
	<script language="Javascript">
	function doConfirm(question,url) {
	var x = confirm(question);
	if (x) {
	window.location.href = url;
	}
	}
 
	function confirm_prompt(text) {
	return confirm(text);
	}
 
	// -->
 
 
	</script>
 
</head>
 
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" onload="initMenu();getCookieData('eStyleDisplay');">
<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%" height="100%">
	<tr>
		<td colspan="3">
		<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
			<tr>
				<td>
				<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
				<tr>
					<td>
						<img border="0" src="images/logo.jpg"></td>
					<td id="header" class="alert">
						<img src="images/alert 2_48x48.png">
					</td>
			</tr>
			</table> 
			</td>
			</tr>
			<tr>
				<td>
<div id="mainMenu">
	<a href="#"><img src="images/back2.png" border="0"> 'D1&J3J)</a>
	<a href="#"><img src="images/send.png" border="0"> E1'3D'*</a>
	<a href="#"><img src="images/uses.png" border="0"> 'D#96'!</a>
	<a href="#"><img src="images/install.png" border="0"> 'D(1'E,</a>
	<a href="#"><img src="images/config.png" border="0"> 'D%/'1)</a>
</div>
<div id="submenu">
	<!-- The first sub menu -->
	<div id="submenu_1">
 
	</div>
	<!-- Second sub menu -->
	<div id="submenu_2">
		<a href="email.php?act=inbox">5F/HB 'DH'1/</a>
		<a href="mobile.php?act=idx">E1C2 'D,H'D</a>
	</div>
	<!-- Third sub menu -->
	<div id="submenu_3">
		<a href="private.php?act=validate&val=0">13'&D 'D#96'!</a>
		<a href="members.php?act=show_waiting">EDA'* 'D#96'!</a>
		<a href="groups.php?act=show_groups">'DE,EH9'*</a>
		<a href="album.php?act=idx">5H1 'D#96'!</a>
	</div>
	<!-- Fourth sub menu -->
	<div id="submenu_4">
		<a href="article.php?act=idx">B3E 'DEB'D'*</a>
		<a href="forum.php?act=idx">EF*/I 'D-H'1</a>
		<a href="poll.php?act=idx">'D*5HJ*</a>
		<a href="adv.php?act=idx">'D%9D'F'*</a>
	</div>
	<!-- Fourth sub menu -->
	<div id="submenu_5">
		<a href="settings.php?act=idx&group_id=1">%9/'/'* 'D4(C)</a>
		<a href="groups.php?act=idx">%/'1) 'DE3*./EJF</a>
		<a href="credits.php?act=add_point">'D(7'B'* H 'D%4*1'C'*</a>
		<a href="admin.php?act=countries">'D/HD H 'D,F3J'*</a>
	</div>
 
</div>
 
</td>
			</tr>
			<tr>
				<td>
				<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
					<tr>
						<td nowrap style="background:url('images/frame_trc.jpg') no-repeat;width:27px;height:44;">
					</td>
						<td width="100%" id="frame_t">{sub_cats}
<div style="display:none" id="cookieData"></div>
						</td>
						<td nowrap style="background:url('images/frame_tlc.jpg') no-repeat;width:27px;height:44;">
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td nowrap width="5" id="right_margin"></td>
		<td height="100%" width="100%">
		<table cellpadding="0" cellspacing="0" width="100%" height="100%">
			<tr>
<!-- SIDE BAR -->
				<td id="testdiv" class="side_bar" style="display:block;" nowrap valign="top">
					<table cellspacing="0" cellpadding="0">
						<tr>
							<td width="100%" class="side_bar_cells">E-1C 'D(-+
								
							</td>
						</tr>
						
						<tr>
							<td width="100%" class="side_bar_cells">%9/'/'*
								
							</td>
						</tr>
					</table>
				</td>
				
				<td class="side_bar2"><img style="cursor:hand;" id="imgToToggle" onclick="toggle_visibility('testdiv');" src="images/expand.jpg"></td>
<!-- END OF SIDE BAR -->
				<td width="100%" align="center" valign="top"><div id="intro">{intro}</div></td>
			</tr>
		</table>
		</td>
		<td nowrap width="5" id="left_margin">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="3">
		<table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
			<tr>
				<td valign="bottom">
				<img border="0" src="images/frame_drc.jpg"></td>
				<td width="100%" id="frame_d">&nbsp;</td>
				<td>
				<p align="left">
				<img border="0" src="images/frame_dlc.jpg"></td>
			</tr>
			<tr>
				<td colspan="3" height="100" id="footer" dir="ltr"><div><label>&copy 2008 ShopiesISD - All Rights Reserved</label><a href="">About</a> - <a href="mailto:webmaster@shopies.com">Contact Us</a></div></td>
			</tr>
		</table>
 
		</td>
	</tr>
</table>
 
</body>
 
</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of vdelau
vdelau
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shopies

ASKER

Perfect vdelau your solution has resolved the first error. How about the second one?
Avatar of Michel Plungjan
how about
getCookieData('eStyleDisplay')

show more code