PDA

View Full Version : Alert user if javascript is turned off: how to to restore vb functionality


Alfa1
04-25-2011, 08:31 AM
When users have their browsers security settings set to 'High', then javascript and cookies is disabled and many functions in vbulletin no longer work. This includes drop downs. To the user the cause of this may not be obvious and vbulletin sites seem uninteresting and dysfunctional.

This negatively affects the number of new registrations and new posts.

To solve this a notice is needed that alerts such users of this problem and informs them how to solve it. A script should detect if users have javascript and cookies turned off. If a user has this turned off a notice should be shown.

Disasterpiece
04-26-2011, 09:15 AM
Simple:

Place a warning box into the template where you like to display it, give it an unique id like id="nojsbox".
Then add a JS function which removes the box:
function has_js() {
var e = document.getElementById("nojsbox");
e.innerHTML = '';
}
Now you just need to call this function.

I'm not the JS guru and can't test it right now, but it should work if you put it into the body onload tag or use jQuery. You'll find the answer via google, but this should point you into the right direction.