This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

iframe re-direct
#1
Hi i was wondering how you would re-direct an iframe url if the requested url is not accessible?

im currently using a dynamic iframe example as below and want to add a re-direct if the requested iframe url is not accessible or times out

Code:
$(function() {
  function seturl(url) {
    $('.iframeurl').find('iframe').attr('src', url);
  }

  $('.btn-1').on('vclick', function() {
    seturl('https://forum.logicmachine.net');
  });

  $('.btn-2').on('vclick', function() {
    seturl('http://openrb.com');
  });
})
Reply
#2
Since iframe points to a different domain you cannot access iframe document at all due to security reasons.
See this for a possible solution: https://stackoverflow.com/a/35838812
Reply


Forum Jump: