CitznFish
10-24-2003, 01:05 AM
Been a while since I've posted here. :)
I have been playing with a simple boolean script. If a guest is viewing either one of teh 2 URL's listed in the if statement, they will not have the HTML table written out. if the guest is viewing a page other than the 2 listed they will get teh table written out. I figured I need the || (or) so if it's URL1 OR URL2 then don't write out the table. However it doesn't work, it only works if I use the && (and) which reads URL1 AND URL2, yet it works just like it was the OR boolean. Any insight as to why, or am I just completely off on this?
<SCRIPT LANGUAGE="JavaScript">
<!--
theURL=location.href;
if (theURL.indexOf("cookbook.app?page=RecipeFinder") == -1 && theURL.indexOf("crafts?page=CraftDisplay") == -1)
{
document.write('<td width="37"> </td>');
document.write('<td align="center" valign="top" width="125">');
document.write(' <table border="0" cellpadding="0" cellspacing="0" width="125">');
document.write(' <tr>');
document.write(' <td align="center" valign="top" width="125" height="605">');
document.write(' <table border="0" cellpadding="0" cellspacing="0" width="125">');
document.write(' <tr>');
document.write(' <td width="2">');
document.write(' <spacer type="block" height="1" width="2">');
document.write(' </td>');
document.write(' <td width="120" align="center">');
}
// -->
</SCRIPT>
I have been playing with a simple boolean script. If a guest is viewing either one of teh 2 URL's listed in the if statement, they will not have the HTML table written out. if the guest is viewing a page other than the 2 listed they will get teh table written out. I figured I need the || (or) so if it's URL1 OR URL2 then don't write out the table. However it doesn't work, it only works if I use the && (and) which reads URL1 AND URL2, yet it works just like it was the OR boolean. Any insight as to why, or am I just completely off on this?
<SCRIPT LANGUAGE="JavaScript">
<!--
theURL=location.href;
if (theURL.indexOf("cookbook.app?page=RecipeFinder") == -1 && theURL.indexOf("crafts?page=CraftDisplay") == -1)
{
document.write('<td width="37"> </td>');
document.write('<td align="center" valign="top" width="125">');
document.write(' <table border="0" cellpadding="0" cellspacing="0" width="125">');
document.write(' <tr>');
document.write(' <td align="center" valign="top" width="125" height="605">');
document.write(' <table border="0" cellpadding="0" cellspacing="0" width="125">');
document.write(' <tr>');
document.write(' <td width="2">');
document.write(' <spacer type="block" height="1" width="2">');
document.write(' </td>');
document.write(' <td width="120" align="center">');
}
// -->
</SCRIPT>