Date:  11/24/2017 10:58:07 PM Msg ID:  004914
From:  Art Bergquist Thread:  004912
Subject:  Re: Development vs. Production web server

Since there are multiple web pages in our web site, I decided to implement JavaScript within a footer .shtml file as follows:

 
    <script type="text/javascript">
      if (<function call to determine if we're running on the development server) {
        document.body.style.backgroundColor = 'yellow';
      }

 

Since every page in the web site includes the footer, then each page will have a yellow background when running on the development server.

Thanks
Sent by FoxWeb Support on 11/22/2017 05:48:56 AM:
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