Date:  11/22/2017 05:48:56 AM Msg ID:  004913
From:  FoxWeb Support Thread:  004912
Subject:  Re: Development vs. Production web server
Is other code in the same page evaluated as expected?
 
I'm not clear on why you have to use Javascript for this. Why not apply a style to your page?
 
<%
if lcDevelopmentServer
    backgroundColor = "yellow"
else
    backgroundColor = "initial"
endif 
%> 
<body style="background-color: <%=backgroundColor%>;">
 
 
FoxWeb Support Team
support@foxweb.com email
Sent by Art Bergquist on 11/22/2017 05:38:24 AM:
Hi,
 
I'm working with both a development server as well as a production web server.
 
When accessing a web page from the development server, I'd like to change the background color of the web page to something other than white (e.g., yellow) to make it obvious to the users that they're in "test" mode (i.e., not looking at the production web page).  I'll have to do this JavaScript unless someone knows another way.
 
I currently have the code in an .FWx:
 
LOCAL llDevelopmentServer, lcDevelopmentServer
llDevelopmentServer = DevelopmentServer()
lcDevelopmentServer = TRANSFORM(m.llDevelopmentServer)
Response.Write('llDevelopmentServer = ' + m.lcDevelopmentServer + '<br>')

PUBLIC glDevelopmentServer, gcDevelopmentServer
glDevelopmentServer = DevelopmentServer()
gcDevelopmentServer = TRANSFORM(m.glDevelopmentServer)

 
Toward the bottom of that .FWx, I have the following JavaScript:

    <script type="text/javascript">
// alert('<%=lcDevelopmentServer%>');
      alert('<%=gcDevelopmentServer%>');
    </script>

(I got the above idea from Msg ID: 003653 / Thread: 003651 in the FoxWeb forum.)
 
Unfortunately, though, when I run the web page, I get a dialog that displays:
 
 <%=gcDevelopmentServer%>
 
In other words, FoxWeb doesn't evaluate the gcDevelopmentServer memory variable.
 
Is there something obvious I'm missing? 
 
TIA,
 
Art Bergquist