CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   How to check if domain is in the 'allowed list'? (http://www.codingforums.com/showthread.php?t=286942)

kenshn111 02-03-2013 02:21 AM

How to check if domain is in the 'allowed list'?
 
I'm sorry if I'm not clear enough, but I believe I've seen sites which uses JavaScript where it checks if the domain is in the 'allowed list' so that it sents out information to that site? Am I in the right forum or does it use .htaccess? D:

Sorry!

Old Pedant 02-03-2013 04:26 AM

Even if JavaScript could do that, it would be useless if a violator simply turned off JavaScript in his/her browser.

And, really, any domain that is hacking your site and/or doing a Denial Of Service attack is not going to be using a browser, anyway.

No, you don't want to even think about JS for this.

rnd me 02-03-2013 05:39 PM

sounds like you're talking about CORS. you can list domains that ajax is allowed to fetch using the "Access-Control-Allow-Origin" header.

there's also the document.domain property which tells you your current domain. If you had a list of domains, you would use document.domain to spot that domain in a lineup.


All times are GMT +1. The time now is 04:28 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.