I'm struggling with a Coldfusion site I have to redesign:
On my Jquery Mobile / Coldfusion8 site users should be able to log in from several different pages (each with it's own login form - can't change this!)
When a user first enters the index.cfm page, I'm running this:
<!--- SESSION handler --->
<cfif Session.loggedIn EQ "No">
<CFPARAM NAME="Attributes.Datasource">
<CFPARAM NAME="Attributes.AdditionalText" DEFAULT="">
...
<CFSET aform = "#CGI.SCRIPT_NAME#">
</cfif>
Which is part of the login routine and sets up all the parameters and variables. I'm getting no errors, so everything must be ok. The page includes a list with one item being:
<li>#Attributes.AdditonalText"</li>
and a login form:
<CFFORM ACTION="#aform#" NAME="LoginForm">
Also, when no session is defined, I'm redirecting to index.cfm, so all users will end up on this page and get their session.
Problem
When the user goes from index.cfm to the next page, Jquery Mobile adds this page to the DOM(!). But the same parameters/variables that were valid on index.cfm now produce errors (both being undefinded).
I don't understand this. Aren't Coldfusion params/variable accessible on a DOM-scale, so any stuff I'm adding dynamically through Ajax and which includes references to these params/variables will also work?
I'm kind of lost on what to do here. Coldfusion newbie, too.
If I have this text in my index.cfm
This is the #attributes.additionalText#
it works, but if I have the same snippet in the 2nd file, which gets appended to the DOM, the exact same snippet returns #attributes.additioanlText# being undefined...
Question:
Why is it that my variables and attributes are not accessible or get undefined on content I dynamically add to the DOM? How can I make them available on a Global Scope?
Thanks for some clues!