Orange
Orange

Reputation: 105

How to check domain

I use JavaScript to insert the specific into the page. The problem is that it is necessery to load this iframe for the specific domain. I mean like in GoogleMaps, where you have to insert special key to be able load maps for your domain.

In few words I want to check where my script is linked from.

Upvotes: 0

Views: 128

Answers (1)

Aamir Mahmood
Aamir Mahmood

Reputation: 2724

You can not get the parent property if your page is not on the same domain, the only solutions is to check the document referrer

var ref = document.referrer;
alert(ref);

Upvotes: 4

Related Questions