If your html is:
<div class="property_container">
<div id="property_#propertyID#" class="login_container">
</div>
</div>

And you want to reference the login container, then all you need is:
$('#property_' + propertyID);

No need to refer to property container at all.

On 12/15/11 7:50 PM, Rick Faircloth wrote:
> The HTML is written so that there is a "property_container"
> that contains a "login container".
>
> So, the we'd be using .find to look inside the .property_container div
> to find the #property_propertyID div and the .login_container div.
>
> The login_container div is only shown when a user clicks on a "star" graphic
> to save the property being viewed as a "favorite"...
>
> So, the simple HTML is:
>
> <div class="property_container">
>
>     <div id="property_#propertyID#" class="login_container">
>
> </div>
>
> The "login_container" is hidden unless needed to login the user.
>
> However, I'm inserted HTML into the login_container div only when
> it's needed to keep down the duplicate code otherwise required.
>
> What's complicating the whole issue is that the .property_container
> is inserted into the .cfm page via cfsavecontent from a .cfc and the
> HTML of the .login_container is being inserted via javascript using
> a function when it's needed. (I tried inserting the js via function
> using a built-up array of code simply because I couldn't get this to
> work by calling up the HTML via a cfc method.)  I've tried several
> approaches, but haven't solved this yet...
>
>
>
> -----Original Message-----
> From: Ricardo Russon [mailto:[email protected]]
> Sent: Thursday, December 15, 2011 10:38 PM
> To: cf-talk
> Subject: Re: (ot) How would I write this js line?
>
>
> Wouldn't there only be one of each ID?
> There should be. So in that case:
>
> var loginContainer =
> $('#property_'+propertyID).find('.login_container')
>
> Otherwise try
>
> var loginContainer =
> $('.property_container[id='+property_'+propertyID+']').find('.login_containe
> r')
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:349188
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to