By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

Error msg: 'null' is null or not an object?

P: 1
When i try to go over the image I get this error message in the browser:

'null' is null or not an object

This is what the files look like:

[PHP] $null_str = substr(md5(uniqid(mt_rand())),0,5);
$img_id = $row[item_nid].'_'.$null_str;
if ($db) {
$t=0;
$db->query("select * from mall_color where mc_pid='$row[item_nid]' and mc_part=0 order by mc_nid");
if ($db->numrow>1) {
while ($mrow = $db->nrecord(1)) {
$color_select .="<td style='padding:2 2 2 2'><a href='javascript:void(0)' onMouseOver=\"getElementById('$img_id').src='image/item_color_big/$mrow[mc_bfile]'\" hidefocus='true'><img src='image/item_color_small/$mrow[mc_sfile]' style='border:1px solid #cccccc' height=10 width=18></a></td>\n";

if (!(++$t%5)) $color_select .="</tr><tr>";
}
}
}[/PHP]
Jul 14 '08 #1
Share this Question
Share on Google+
4 Replies


Expert 10K+
P: 11,448
That is definitely not Java code; do you mean Javascript perhaps?

kind regards,

Jos (moderator)

ps. tell me whether you want me to delete this thread or move it over to a
Javascript forum.
Jul 14 '08 #2

100+
P: 283
Definitely php and javaScript problem here.
Jul 14 '08 #3

10K+
P: 13,264
Why is it always my duty to take out the trash?
<Moved to PHP forum>
Jul 15 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Actually a JavaScript error message, so moved to the JavaScript forum.

getElementById is a document method, not a window one, so should be document.getElementById().
Jul 16 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.