I had an issue the other day where one of my users logged into a development app accidentally instead of production.
So, I wanted something to let the user know they weren't in production, but not something I'd have to change when I migrated the app to production.
My development and test apps share a domain name, my production is on a separate domain.
Javascript has a helpful function that returns your host name "window.location.hostname"
So, I created a dynamic "onLoad" action on my login page.. with a true action of "Execute Javascript"
2 lines below are all that were needed (replace hostnaame and text as needed)
if (window.location.hostname == "hostname.com")
window.alert("This is the development system. Any changes made here will not be made in live.");
Simple and efficient.
Cheers,
Scott
Subscribe to:
Comments (Atom)
How Generative AI can save you time programming menial tasks
To paraphrase the rock band Staind, It's been a while since I blogged. And since every tech blog these days is talking about AI, I fig...
-
It's been a while since I updated for 2 reasons I'm extremely lazy with posting and keeping up with things I really haven't done...
-
To paraphrase the rock band Staind, It's been a while since I blogged. And since every tech blog these days is talking about AI, I fig...
-
I encountered a situation recently where I added a field to a table, and needed to update data due to that field. I realized manually doing...
