I'm trying to create a program to keep the alert display when viewing the production web page.
For example, I have two pages as follows:
Only when viewing the PROD page, I'd like to display the alert that covers the content. Please see the image I attached.
As I'm beginner of programing, I have no idea how to realize it. Could anyone give me an advice for this? I have basic knowledges of HTML/CSS/Java/JS.
Thank you!
Let's define a function like this:
function alertProd(url, prodPattern) {
if (url.indexOf(prodPattern) >= 0) alert("PROD!");
}
alertProd(window.location.href, "stacksnippets");
Note that I have used stacksnippets as pattern, you will need to change it to 456 when you call the function.