View Full Version : javascript - should but not working on host server

06-08-2010, 11:46 AM
Is there any javascripts to make a site,
not working on hosting but it should work perfectly in locally?
should give some errors, when the site is going to hosting.

can it be happened ??? Is there any javascripts ???


06-08-2010, 06:48 PM
You post is not clear. I do not understand the question, and you should try to phrase things more clearly. For example, "???" and "!!!!!" don't help make things clear-- use more words, give us links, and explain the SPECIFIC problem.

As a short answer (I think this is what you're asking), yes, some things can be different locally and on a server. But this isn't because of the server: it's because of the browser and security settings.

06-09-2010, 01:19 AM
well, djr33 this is my requirement.

I have designed a site. It's working properly in locally.

Now I want to insert a special javascript on my home page.

The job of that special javascript is, makes some errors in the site when site is going to publish on internet.

The site should run on locally but not on server

Is there any, this kind of special javascript...

06-09-2010, 02:20 AM
Ok. You want to DISABLE the site using Javascript, when the site is online?

I don't understand the reasons, but you should be able to check the URL and use location.href to redirect the browser if needed.

06-09-2010, 02:37 AM
If you are trying to use javascript to disable your site, you should be aware that javascript can be turned off by the user. This makes it completely unreliable for any security purposes.

Also - and I assume I must be misunderstanding something - why would you want to put your site online, but make it inoperable? If you only want it to function locally, why put it on the internet at all?

06-09-2010, 02:59 AM
hmmmm, I know that's a strange requirement :(. But that's a test for me...
Then someone will check this code whether i'm correct or not under that strange requirement.
so please help me. :confused:

if it is hard find a javascript, please tell me a another method to do it.

06-09-2010, 06:55 AM
well, as I said, javascript won't be reliable because it runs on the user's computer. The user has complete control, and can just turn it off if desired.

To really secure anything, you need a server-side script. You can use PHP to deny access to unauthorized users, or use .htaccess to redirect all requests for the page so it's completely inaccessible.

06-09-2010, 12:11 PM
Yes! you are correct traq. the script can be removed by the user.But it's doesn't matter. no need to use sever side language.
As i said this is a test for me.They are not going to remove it.Because they only want to test me.
so it's more than enough if you can help me with javascript.

thank you very much.

06-09-2010, 01:50 PM
javascript isn't really my specialty. Is this a school assignment?

06-09-2010, 03:17 PM
this is not a school assignment. but it like a assignment for me....
i'm a beginner to web design. hope you'll help me.