Hi All, For those of you that want to see the contact of Terascript vars in the Javascript console. with out it messing up the output of the page. note: I’ve attached the file JSON_Utilities.tcf to this email.
Try This.
Snippet DumpVars_Console (don’t include the <pre> tag in the snippet)
<pre>
<@IF EXPR="'<@domain>' = 'demo.tronics.com'">
<@IFEMPTY VALUE="<@var domain$JSONUtilities>">
<@ASSIGN NAME="JSONUtilities" SCOPE="domain"
VALUE=<@CREATEOBJECT OBJECTID="JSON_Utilities.tcf" TYPE="TCF">>
</@IF>
<!-- <@APPFILENAME>:<@CURRENTACTION> -->
<script type='text/javascript'>
//request scope
<@IFNOTEMPTY <@var request$_function>>'_function = <@var
request$_function>';</@IF>
<@ASSIGN NAME="theVars" VALUE="<@VARNAMES SCOPE='request'>" SCOPE="request">
<@FOR START="1" STEP="1" STOP="<@NUMROWS ARRAY='theVars'>">
<@assign
NAME="logRes"
SCOPE="request"
VALUE=<@CALLMETHOD OBJECT="JSONUtilities" SCOPE="domain"
METHOD="Array2JSON(<@VAR
@@request$theVars[<@CURROW>,1]>)"
METHODTYPE="invoke"
>
>
var @@request$theVars[<@CURROW>,1] = <@VAR request$logRes>;
console.log('request$@@request$theVars[<@CURROW>,1] -> ');
console.log(@@request$theVars[<@CURROW>,1]);
</@FOR>
//user scope
<@ASSIGN NAME="theVars" VALUE="<@VARNAMES SCOPE='user'>" SCOPE="request">
<@FOR START="1" STEP="1" STOP="<@NUMROWS ARRAY='theVars'>">
<@assign
NAME="logRes"
SCOPE="request"
VALUE=<@CALLMETHOD OBJECT="JSONUtilities" SCOPE="domain"
METHOD="Array2JSON(<@VAR
@@request$theVars[<@CURROW>,1]>)"
METHODTYPE="invoke"
>
>
var @@request$theVars[<@CURROW>,1] = <@VAR request$logRes>;
console.log('user$@@request$theVars[<@CURROW>,1] -> ');
console.log(@@request$theVars[<@CURROW>,1]);
</@FOR>
</script>
</@IF>
</pre>
----------------------------------------
To unsubscribe from this list, please send an email to [email protected]
with "unsubscribe terascript-talk" in the body.
JSON_Utilities.tcf
Description: Binary data
Ben Johansen http://www.webspinr.com [email protected] Phone: 360-600-7775 ---------------------------------------- To unsubscribe from this list, please send an email to [email protected] with "unsubscribe terascript-talk" in the body.
