I've had to go to three if statements to get this to
work.  It didn't want to let me use the or '||' operator.

Also, had to start using != in one statement.

Here's what's working properly whether the modal menu
(smartphone website) is being used on the homepage,
'index.cfm' or '':

if  (  activeLinkID === 'search_properties' && currentPage === 'index.cfm'
)
    {  window.location = 'modules/search-properties/search-properties.cfm';
}

if  (  activeLinkID === 'search_properties' && currentPage === ''
)
    {  window.location = 'modules/search-properties/search-properties.cfm';
}

if  (  activeLinkID === 'search_properties' && currentPage != 'index.cfm' &&
currentPage != ''   )
    {  window.location = '../search-properties/search-properties.cfm';
}





-----Original Message-----
From: Lists [mailto:[email protected]] 
Sent: Tuesday, October 04, 2011 10:36 PM
To: cf-talk
Subject: Re: Shouldn't these statements work?


The triple === in JavaScript at least is a strict comparison. It not only
checks for truthiness, but that both sides are the same type. 

Have you tried simple eq or == 

On Oct 4, 2011, at 9:17 PM, "Rick Faircloth" <[email protected]>
wrote:

> 
> if  (  activeLinkID === 'search_properties' && currentPage === 'index.cfm'
> )
>    {  window.location = 'modules/search-properties/search-properties.cfm';
> }
> 
> if  (  activeLinkID === 'search_properties' && currentPage === ''
> )
>    {  window.location = '../search-properties/search-properties.cfm';
> }
> 
> My first code, that still seems valid, was:
> 
> if   (  activeLinkID === 'search_properties' && (currentPage ===
'index.cfm'
> || currentPage === '')  )
>     {  window.location = 'modules/search-properties/search-properties.cfm'
> }
> else {  window.location = '../search-properties/search-properties.cfm'
> }
> 
> 
> No syntax errors, but the page is not changed
> to search-properties.cfm.
> 
> These lines are bypassed as if conditions are not met,
> and the conditions are met.
> 
> They work if the URL ends in 'index.cfm', but not if the
> URL is just the domain name.
> 
> I've tried every version of this I can think of.
> 
> Clues, anyone?
> 
> Rick
> 
> 
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:347932
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to