JavaScript Javascript frame killer with exceptions

I'm using that code to kill frames using my page:

if(self == top) {
       document.documentElement.style.display = 'block'; 
    } else {
            top.location = self.location;
    };

But I want add some exception for one domain and add another condition:

if(self == top) {
       document.documentElement.style.display = 'block'; 
    } else {
        if (window.location.host != "www.linuxportal.pl") {
            top.location = self.location;
        };
    };

But it won't work. Script kills every frame, even from www.linuxportal.pl. How to make script to kill every frame but leave frame in www.linuxportal.pl only?

Answer:1

I've created a convenience method that adds a default error handler for my ajax calls: function myAjaxFunction(url, data) { return $.ajax({ url: url, data: data }).fail(...

I've created a convenience method that adds a default error handler for my ajax calls: function myAjaxFunction(url, data) { return $.ajax({ url: url, data: data }).fail(...

I fail to make a checkbox do a simple alert like I try here: https://jsfiddle.net/2n3dyLhh/5/ The problem is datatables (or how I use it) because when I do not include the library the listeners work ...

I fail to make a checkbox do a simple alert like I try here: https://jsfiddle.net/2n3dyLhh/5/ The problem is datatables (or how I use it) because when I do not include the library the listeners work ...

I'm using fancyBox v2.1.4. In Chrome it's allowing scrolling of the main page when the fancyBox is open. I'm utilizing the locked: true but that doesn't seem to solve the issue. I have also ...

I'm using fancyBox v2.1.4. In Chrome it's allowing scrolling of the main page when the fancyBox is open. I'm utilizing the locked: true but that doesn't seem to solve the issue. I have also ...

I'm using this code to prevent people from puting spaces between alphabets and numbers. I would lilke to modify the code so that only alphabets, letters and numbers can be typed. This is what i'm ...

I'm using this code to prevent people from puting spaces between alphabets and numbers. I would lilke to modify the code so that only alphabets, letters and numbers can be typed. This is what i'm ...

  1. regex javascript allow spaces
  2. regex javascript allow special characters
  3. regex javascript allow only numbers
  4. javascript regex allow only alphanumeric and spaces
  5. javascript regex allow only numbers and dot
  6. javascript regex allow only one dot
  7. javascript regex allow empty string
  8. javascript regex allow only alphanumeric
  9. javascript regex allow dash
  10. javascript regex allow only letters and numbers
  11. javascript regex allow numbers and decimals only
  12. javascript regex allow numbers and dashes
  13. javascript regex allow whitespace
  14. javascript regex allow negative numbers
  15. javascript regex allow only letters
  16. javascript regex allow hyphen
  17. javascript regex allow some special characters
  18. javascript regex allow only one space
  19. javascript regex allow backslash
  20. javascript regex allow parentheses