...

View Full Version : firebug throwing error -- 'zxcobj.srtfin[0] has no properties'



canadianjameson
08-23-2007, 10:32 PM
Hey all,

I finally managed to reliably cause an error to occur (using FF and Firebug).
A screen shot of error has been uploaded to www.enviromark.ca/head/zxcobj.srtfin[0].gif

How you can recreate this is by following these steps... it is somewhat tricky to make happen, but it happens about 10 times a day to me as I preview the page

go to www.enviromark.ca/head/YPPInclude.php

as you can see, onmouseover an underline appears under the text links

now, if you can manage to do it, hit F5 (refresh) and as the page is refreshing onmouseover the any of the text links. You will see that the link you just onmouseover'd will stay underlined, and every time you go over it with your cursor it throws another error


Would simply using a watchdog() script prevent this from occurring?

---------------------------

The second glitch occurring is a simple one to fix so i figured I would post it here

go to www.enviromark.ca/head/YPPInclude.php
click the fourth B&W vertical icon
Click 'Medical Services' and the top border will be the same color as the text
(what i want -- i set that here:
zxcBorder('border-Top',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',2,0); return false"

Now click any other text link (such as 'Clinics')
and the click 'Medical Services' again.
The top border reverts to being black even though it is set to something else....


Any ideas?

vwphillips
08-24-2007, 12:55 AM
try


function zxcBorder(zxcmde,zxcobj,zxctime,zxcsrt,zxcfin,zxcborder,zxcgrp,zxclevel){
if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
var zxcevt=window.event||arguments.callee.caller.arguments[0];
if (!zxcobj.srtfin) zxcobj.srtfin=[zxcsrt,zxcfin];
var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
else if (zxcobj.srtfin) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin[0]:zxcobj.srtfin[1],'sin',zxctime)
else return;
// section for use with div toggle
if (zxcevt.type=='click'&&zxcgrp){
if (!zxcTBAry[zxcgrp]) zxcTBAry[zxcgrp]=[];
for (var zxc0=0;zxc0<zxcTBAry[zxcgrp].length;zxc0++){
if (zxcTBAry[zxcgrp][zxc0][0]==zxcobj) zxcTBAry[zxcgrp].splice(zxc0,1);
}
zxcTBAry[zxcgrp].push([zxcobj,zxclevel]);
for (var zxc0=1;zxc0<zxcTBAry.length;zxc0++){
if (zxcTBAry[zxc0]){
for (var zxc0a=0;zxc0a<zxcTBAry[zxc0].length;zxc0a++){
if (zxc0!=zxcgrp||(zxcTBAry[zxc0][zxc0a][1]>=zxclevel&&zxcTBAry[zxc0][zxc0a][0]!=zxcobj)){
var zxcnobj=zxcTBAry[zxc0][zxc0a][0];
var zxcoop=zxcnobj[zxcmde.replace('-','')+'oop'];
zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
}
}
}
}
}
// end section for use with div toggle
}

vwphillips
08-24-2007, 02:22 AM
The script was designed for same srt fin for border top and bottom

now for different colors


function zxcBorder(zxcmde,zxcobj,zxctime,zxcsrt,zxcfin,zxcborder,zxcgrp,zxclevel){
if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
var zxcevt=window.event||arguments.callee.caller.arguments[0];
if (zxcevt.type!='click'){
if (!zxcobj.srtfin) zxcobj.srtfin=[zxcsrt,zxcfin];
var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
else if (zxcobj.srtfin) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin[0]:zxcobj.srtfin[1],'sin',zxctime)
}
// section for use with div toggle
if (zxcevt.type=='click'&&zxcgrp){
if (!zxcobj.srtfin1) zxcobj.srtfin1=[zxcsrt,zxcfin];
var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
else if (zxcobj.srtfin1) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin1[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin1[0]:zxcobj.srtfin1[1],'sin',zxctime)
else return;
if (!zxcTBAry[zxcgrp]) zxcTBAry[zxcgrp]=[];
for (var zxc0=0;zxc0<zxcTBAry[zxcgrp].length;zxc0++){
if (zxcTBAry[zxcgrp][zxc0][0]==zxcobj) zxcTBAry[zxcgrp].splice(zxc0,1);
}
zxcTBAry[zxcgrp].push([zxcobj,zxclevel]);
for (var zxc0=1;zxc0<zxcTBAry.length;zxc0++){
if (zxcTBAry[zxc0]){
for (var zxc0a=0;zxc0a<zxcTBAry[zxc0].length;zxc0a++){
if (zxc0!=zxcgrp||(zxcTBAry[zxc0][zxc0a][1]>=zxclevel&&zxcTBAry[zxc0][zxc0a][0]!=zxcobj)){
var zxcnobj=zxcTBAry[zxc0][zxc0a][0];
var zxcoop=zxcnobj[zxcmde.replace('-','')+'oop'];
// zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
}
}
}
}
}
// end section for use with div toggle
}

canadianjameson
08-24-2007, 07:27 PM
Hey Vic :)

The modification for the color works like a charm, and I'm now implementing it on all of my links :) The modification for preventing the error doesn't seem to have worked... could it be that this is because the element to which the script is being applied exists on the page during a 'reload' or 'new page loading', but the script hasn't been initialized yet?

Would applying a watchdog to every page work? the onmouseover script could call the watchdog, which would verify if the script has loaded yet and if not wait until it had to call it. It's just an idea, and I know it's a bit of a roundabout way of doing things, but it might work :D

oh, i noticed you commented out

// zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)

I was wondering what the use of it was?

vwphillips
08-24-2007, 10:31 PM
I am having trouble simulation this but

move zxcInitBorderGrp('pageHolder','border-Bottom','A',1000,2000,'#FFFFFF','#000000','solid #000000 1px');

from the pageHolder div mouseover to the <BODY> on load and


function zxcBorder(zxcmde,zxcobj,zxctime,zxcsrt,zxcfin,zxcborder,zxcgrp,zxclevel){
if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
var zxcevt=window.event||arguments.callee.caller.arguments[0];
if (zxcevt.type!='click'){
if (!zxcobj.srtfin) zxcobj.srtfin=[zxcsrt,zxcfin];
var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
else if (zxcoop.data) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin[0]:zxcobj.srtfin[1],'sin',zxctime);
}
// section for use with div toggle
if (zxcevt.type=='click'&&zxcgrp){
if (!zxcobj.srtfin1) zxcobj.srtfin1=[zxcsrt,zxcfin];
var zxcoop=zxcobj[zxcmde.replace('-','')+'oop'];
if (!zxcoop) zxcAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,'sin',zxctime,zxcborder);
else if (zxcobj.srtfin1) zxcAnimator(zxcmde,zxcobj,(zxcobj.srtfin1[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],(zxcevt.type=='mouseout')?zxcobj.srtfin1[0]:zxcobj.srtfin1[1],'sin',zxctime)
else return;
if (!zxcTBAry[zxcgrp]) zxcTBAry[zxcgrp]=[];
for (var zxc0=0;zxc0<zxcTBAry[zxcgrp].length;zxc0++){
if (zxcTBAry[zxcgrp][zxc0][0]==zxcobj) zxcTBAry[zxcgrp].splice(zxc0,1);
}
zxcTBAry[zxcgrp].push([zxcobj,zxclevel]);
for (var zxc0=1;zxc0<zxcTBAry.length;zxc0++){
if (zxcTBAry[zxc0]){
for (var zxc0a=0;zxc0a<zxcTBAry[zxc0].length;zxc0a++){
if (zxc0!=zxcgrp||(zxcTBAry[zxc0][zxc0a][1]>=zxclevel&&zxcTBAry[zxc0][zxc0a][0]!=zxcobj)){
var zxcnobj=zxcTBAry[zxc0][zxc0a][0];
var zxcoop=zxcnobj[zxcmde.replace('-','')+'oop'];
zxcAnimator(zxcmde,zxcnobj,(zxcnobj.srtfin[0].match('#'))?zxcRGBtoHex(zxcoop.data[2][0],zxcoop.data[2][1],zxcoop.data[2][2]):zxcoop.data[2],zxcsrt,'sin',zxctime)
}
}
}
}
}

canadianjameson
08-24-2007, 10:39 PM
I'll test it out now, thanks Vic.

I am able to simulate it by putting my mouse over a text-link and then hit F5, which causes the page to refresh. right after I hit F5 i wiggle my mouse over and off the link and it produces the error almost every time.

Is there any way to code in an exclusion criteria into the onload call, or even into the script to say

"if class = zxcNOBORDER then do not apply the script to elements in this div"?

because pageHolder contains the entire page, so every link in it will have this applied to it (which is what I want, with a few exceptions)

canadianjameson
08-24-2007, 10:54 PM
Perfect Vic, the move to onload worked like a charm! (so far, i have to leave in 10 minutes so may not be able to test it 100%, but it looks like its working!

can we apply the same logic to the links_BW fades? I ask because if you click on any of the B&W vertical images they no longer fade out and stay that way like they used to because the page is being reloaded every time.

vwphillips
08-25-2007, 12:03 AM
function zxcInitBorderGrp(zxcid,zxcmde,zxctag,zxctimeover,zxctimeout,zxcsrt,zxcfin,zxcborder){
var zxcp=document.getElementById(zxcid);
var zxcels=document.getElementById(zxcid).getElementsByTagName(zxctag);
for (var zxc0=0;zxc0<zxcels.length;zxc0++){
if (zxcels[zxc0].className&&zxcels[zxc0].className.match('zxcFB')){
zxcels[zxc0].onmouseover=function(){ zxcBorder(zxcmde,this,zxctimeover,zxcsrt,zxcfin,zxcborder); }
zxcels[zxc0].onmouseout=function(){ zxcBorder(zxcmde,this,zxctimeout,zxcfin,zxcsrt); }
}
}
zxcp.onmouseover=null;
}


<div id="linksMedical">
<a href="#servicesMedical" class=" zxcFB" onclick="zxcToggle('servicesMedical',1,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid white 1px',1,0); return false;">Medical Services</a>
<a href="#clinicsMedical" class=" zxcFB" onclick="zxcToggle('clinicsMedical',2,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',2,0); return false">Clinics</a>
<a href="#workshopsMedical" class=" zxcFB" onclick="zxcToggle('workshopsMedical',3,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',3,0); return false">Workshops</a>
<a href="#calendarMedical" class=" zxcFB" onclick="zxcToggle('calendarMedical',4,0); zxcBorder('border-Left',this,1000,'#FFFFFF','#0000A0','solid #0000A0 1px',4,0); return false">Calendar</a>
</div>

vwphillips
08-25-2007, 12:06 AM
can we apply the same logic to the links_BW fades? I ask because if you click on any of the B&W vertical images they no longer fade out and stay that way like they used to because the page is being reloaded every time.
__________________


can you make absolutely sure that the cookie method meets the requirement before I put more work into this



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum