LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » HTML-CSS-PHP-JavaScript / JavaScript Codes » Secure Your WebPage From Being Iframed In Others Site

Secure Your WebPage From Being Iframed In Others Site

Secure-Your-WebPage-From-Being-Iframed-In-Others-Site
Many sites displays the others site under the particular IFRAME as well as the others site owner don’t want their site to possibly be displayed it within the IFRAME of others site. Same here if you would like protect your site to possibly be displayed within the IFRAME then this can be a tips to suit your needs.

The above code is simple. First off, it is usually checked that if URL in the top frame is unique to the particular URL that contains the JavaScript signal, if they are different then a website comes outside the IFRAME as well as gets displayed inside browser and the others website redirected toward your site. This is the way we can stop your web site being viewable inside IFRAME but realize that JavaScript must be enabled in any other case the signal won’t get any activity.

Table of Contents

Features:

1.) Pure JavaScript Code.
2.) Will Redirect The Others Website To Your Website.
3.) No Need For Customizing.
4.) Quick To Load And Easy To Add.
5.) No Extra Codes Or External File Added.
6.) Cross Browser Compatible.
7.) JavaScript Enabled Browser Needed.
8.) Should Be Add In Your Every Page.

Recommended For You:
Show/Hide Child Sub-Menu Vertically Using Pure JavaScript

Add the following codes in your every web page anywhere.

<script type="text/javascript">
if(window.top.location.href != window.href)
{
window.top.location = window.href;
}
</script>

Or

<script type="text/javascript">
if (top.location.href != self.location.href)
{
top.location.href = self.location.href;
}
</script>

No need to customize it anymore.

Last Words:

After reading and using our tutorial, you just know that how easy it is but one fact is common that at the time of need, people forget the easiest thing but still remember the hard one. Anyway thanks for reading our tutorial, Just leave your impression in our comment box and also ask your quires freely…

You Like It, Please Share This Recipe With Your Friends Using...

Be the first to write a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *