PDA

View Full Version : Error when going to customer only sections


Jan
30-Apr-2003, 09:21 PM
I have implemented the solution from the advanced user guide that allows you to go bounce people out of certain sections if they are not logged in.

However whenever a logged in user goes to the section that uses the new template I get an error message. (runtime error occured, line 110, object expected)

My web site is http://www.mole-end.biz/acatalog/index.html, log in using test, test and then go to the mailing list section which is the last section to see the error in action.

Any ideas?

Jan
01-May-2003, 08:13 AM
I have fixed this now - the actNotRegistered{} function has not defined for B2B sites because of the placement of the NOTINB2B tags, so I have moved them down into the function body to ensure that it is defined but does nothing.

This is what my changes are like now.

<Actinic:NOTINB2B>
<meta http-equiv="Refresh" content="0; url=NoEntry.html">
</Actinic:NOTINB2B>
<script language="javascript1.1">
function actNotRegistered(){
<Actinic:NOTINB2B>
location.replace ('NoEntry.html');
</Actinic:NOTINB2B> }
</script>

I have seen the other messages about this problem but I tried to remove spaces etc but it made no difference.

Jan
01-May-2003, 08:26 AM
Correction : that last bit of code didn't work after all - but this one does.

Note that I had to move the NOTINB2B tags and then comment them out to get rid of the problem - now I know why I am not a Javascript programmer :-)

<Actinic:NOTINB2B>
<meta http-equiv="Refresh" content="0; url=NoEntry.html">
</Actinic:NOTINB2B>
<script language="javascript1.1">
function actNotRegistered(){
//<Actinic:NOTINB2B>
location.replace ('NoEntry.html');
//</Actinic:NOTINB2B> }
</script>

Jan
01-May-2003, 09:19 AM
Another bug has raised it's ugly head. This is the real working code. The difference is that the closing bracket is now on it's own line.

<Actinic:NOTINB2B>
<meta http-equiv="Refresh" content="0; url=NoEntry.html">
</Actinic:NOTINB2B>
<script language="javascript1.1">
function actNotRegistered(){
//<Actinic:NOTINB2B>
location.replace ('NoEntry.html');
//</Actinic:NOTINB2B>
}
</script>

Regards

cdicken
02-May-2003, 10:10 AM
Thanks Jan

I will amend the code in the Advanced User Guide.

0-zone
14-Mar-2004, 08:36 AM
surely the "on load " element is not needed?, you are providing two seperate methods of refresh~ meta and javascript location.replace

when the ~

<Actinic:NOTINB2B>
<meta http-equiv="Refresh" content="0; url=NoEntry.html">
</Actinic:NOTINB2B>

is parsed the page will be re directed if the tag evaluates to true ?

-- if I am correct - you have two choices- either the above
or the javascript function:-


onLoad="NETQUOTEVAR:ONLOAD;actNotRegistered()"
with~

<script language="javascript1.1">
function actNotRegistered(){
<Actinic:NOTINB2B>
location.replace ('NoEntry.html');
</Actinic:NOTINB2B>
}
</script>

(*note comment outs removed- since it would appear that the only way your function would work "some of the time" rather than "all of the time" is to create a conditional based on the NOTINB2B call - if it was working then I can only suggest the Actinic:NOTINB2B call is executed regardless of the commenting out.... the bracket on a new line was needed because the bracket was on a commented out line- ergo- unavailable, (its not a bug... just harder to see without using closing tag form of commenting out))


If I am being stupid please let me know
:)

cdicken
15-Mar-2004, 03:36 PM
It looks like you are right. I have no idea why there are both methods - I've never really clocked it before. All I know is it works. Feel free to use one or the other on your store. I'll clarify the documentation when the next major release comes out.