We need to block all requests inside a page loaded in an IFRAME tag. The page are located in the same domain, but we need to prevent the navigation in the inside page. Obviously, we don't know the elements in the inner page. They may be links (anchor link) Javascript calls, JQuery calls, Ajax calls, From submit and so on.
Here is the way we can handle simple tags and standard submit of a form:
$('a').click(function (event) {
event.preventDefault();
return false;
});
$(this).submit(function (event) {
event.preventDefault();
return false;
});
For example the first function work good but it is only an tag, but if the is triggered using JQuery that function does not work.
The second work fine only for standard form submit, but not Ajax submits.
Is there a way to handle all the events?