Was interested, so I took some time to figure this out too...
Here is my similar solution..
function showNotes(a,b){
eval(b).innerHTML = a;
}
-----Original Message-----
From: Marlon Moyer [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 28, 2005 9:39 AM
To: [email protected]
Subject: Re: javascript question
Ron, your inline function passes two strings to the showNotes function. In
your showNotes function, you need to resolve the object by the name you
passed.
function showNotes(a,b){
var noteDiv = document.getElementById(b);
noteDiv.innerHTML = a;
}
On 9/28/05, Ron Mast <[EMAIL PROTECTED]> wrote:
>
>
>
> Good morning,
>
>
>
> Check out my code below, where I have the <div> tag is where I want
> it. I want to replace the partial note displayed at the beginning
> with the full note when the user clicks on it.
>
> I guess I don't understand why this doesn't work. Can someone explain
> why? Thanks in advance.
>
> -----------------------------------------
>
>
>
> <script language="JavaScript">
>
> <!--
>
> function showNotes(a,b){
>
> b.innerHTML = a;
>
> }
>
> -->
>
> </script>
>
>
>
> <CFQUERY NAME="displayNotes" DATASOURCE="customerNotes"
> DBTYPE="ODBC">
>
> SELECT ID, belongsToID, customerNumber, publishDate, theNotes,
> salesRep, read, subject
>
> FROM allNotes
>
> WHERE customerNumber = #session.customerNumber#
>
> and belongsToID = '#url.noteID#'
>
> </CFQUERY>
>
>
>
> <cfloop query="displayNotes">
>
> <cfif read is "no">
>
> <cfset unreadNote = "true">
>
> <cfbreak>
>
> <cfelse>
>
> <cfset unreadNote = "false">
>
> </cfif>
>
> </cfloop>
>
>
>
> <table cellspacing="0" cellpadding="0" border="0" width="98%">
>
> <cfset altBGC = 1>
>
> <cfoutput query="displayNotes">
>
> <cfset divVar = "greeting_"¤tRow>
>
>
>
> <tr bgcolor="###IIF(altBGC MOD 2, de("ffffff"),de("D9DDBC"))#">
>
> <td width="25%">
>
> <cfif displayNotes.recordcount gte 1>
>
> <cfif unreadNote>
>
>
> <strong>#subject# </strong>
>
> <cfelse>
>
>
> <strong>#subject# </strong>
>
> </cfif>
>
> <cfelse>
>
>
>
> </cfif>
>
> </td>
>
> <td rowspan="2" valign="top">
>
> <cfif unreadNote>
>
> <strong><a
> href="javascript:showNotes('#theNotes#','#divVar#');"
> class="Maroon"><div id="#divVar#">#mid(theNotes, 1,
> 50)#...</div></a></strong>
>
> <cfelse>
>
> #mid(theNotes, 1, 50)#
>
> </cfif>
>
> </td>
>
> <td width="12%" align="center">
>
> <cfif unreadNote>
>
>
> <strong>#dateFormat(publishDate, 'mm/dd/yyyy')#</strong>
>
> <cfelse>
>
>
> #dateFormat(publishDate, 'mm/dd/yyyy')#
>
> </cfif>
>
> </td>
>
> </tr>
>
> <tr bgcolor="###IIF(altBGC MOD 2, de("ffffff"),de("D9DDBC"))#">
>
> <td>
>
> <font size="-2">
>
> <a href=""
> class="Maroon">Edit</a> |
>
> <a href=""
> class="Maroon">Reply</a> |
>
> <a href=""
> class="Maroon">Delete</a>
>
> </font>
>
> </td>
>
> <td></td>
>
> </tr>
>
> <cfset altBGC = altBGC + 1>
>
> </cfoutput>
>
> </table>
>
>
>
> Ron Mast
>
> Webmaster
>
> Truth Hardware
>
> Ph: 507-444-4748
>
> Fx: 507-444-5361
>
> www.truth.com
>
>
>
> _______________________________
>
> This e-mail and any files transmitted with it are confidential and are
> intended solely for the use of the individual to whom they are
> addressed. If you are not the intended recipient or the individual
> responsible for delivering the e-mail to the intended recipient,
> please be advised that you have received this e-mail in error and that
> any use, dissemination, forwarding, printing, or copying of this
> e-mail is strictly prohibited.
--
Marlon
"And I Sleep, and I dream of the person I might have been, and I'll be free
again And I Speak, like someone who's been to the highest peaks, and back
again And I Swear, that my grass is greener than anyones, until I believe
again"
----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
http://www.dfwcfug.org/form_MemberRegistration.cfm
----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
http://www.dfwcfug.org/form_MemberRegistration.cfm