I want to recommend the user to turn on js for a better browsing experience when js is turned off. I was thinking to do this with an absolute div and directly after i declare this, hide it through js (any other thoughts how to do this are welcome). However how can I let the user hide this div through a button when js is turned off?
Share
You can do this through CSS3 as shown in the solution of @kojiro. However you will also want to hide that div the next time the page loads because otherwise you’ll be annoying your visitor. For this reason you may want to load within that div an iframe containing a form that would not only do the CSS3 trick but also on submit let the system know that the user does not want to display the div anymore. Your business logic then needs to record the user’s IP when the iframe form is submitted. In PHP this this is for example
Because you can’t use sessions since .js is turned off, you’ll have to record this in a database table. When the user loads the next page, record the user’s IP and look it up in that table. When it exists, disable the div from parsing. F.e.