one option is to hide the <body> by default using css and then use javascript to unhide the <body>.

Jaynesh
—
2012-01-07T08:35:37Z —
#4

Sorry, How do I check server side?

Jaynesh
—
2012-01-07T08:41:26Z —
#5

Max Height said:

one option is to hide the <body> by default using css and then use javascript to unhide the <body>.

Hi, how would I use jquery to unhide the body?

Jaynesh
—
2012-01-07T08:43:53Z —
#6

Also, using css is it possible for the user to simply change the css and get access to the content?

system
—
2012-01-07T08:44:31Z —
#7

Why would you want to use jquery for something so simple to do with vanilla javascript.

body {
display: none;
}

window.onload=function(){
document.body.style.display='block';
}

guido2004
—
2012-01-07T08:47:10Z —
#8

Jaynesh said:

Also, using css is it possible for the user to simply change the css and get access to the content?

Yes. If they want to. Everything you do client side can be bypassed by the user.

Why do you want to hide the content of your side?

system
—
2012-01-07T08:48:58Z —
#9

Jaynesh said:

Also, using css is it possible for the user to simply change the css and get access to the content?

yes it is. So if that's an issue for you, then hopefully guido2004 will come back to show you how to do it server side.

Jaynesh
—
2012-01-07T08:50:07Z —
#10

Thank you for your responses. I have managed to disable access however is there an alternative to CSS I don't want the user editing the css and viewing the content if the js is disabled.

guido2004
—
2012-01-07T08:59:33Z —
#11

I don't quite understand what you're trying to achieve? 1) Are you hiding the content with JS, and when a user disables JS that hiding doesn't work? 2) Or do you want to hide the content ONLY if the user has JS disabled? If so, why?3) Something else?

If it's 1), then you could check server side (using PHP or any other server side language) to show or not show any content you want in any given circumstance.If it's 2), then you can't do anything server side, because the server can't know if the client has JS enabled or not.

system
—
2012-01-07T09:40:28Z —
#12

Another option:

In the <head> use javascript to redirect to a page for javascript enabled browers

If javascript is disabled, then you will stay on the original page and you then display appropriate content for javascript disabled browsers.

You don't need to bother the server at all

Jaynesh
—
2012-01-07T10:17:11Z —
#13

Hi thank you for your responses. I'm trying to completely restrict content for users that have js disabled.