0

I have the following

 <iframe src="http://website.com:352/pictures/1">

How would I append a No Redirect such as upon visiting

"http://website.com:352/pictures/1?noRedirect"

1 Answer 1

1

Give the iframe and id so you can get a handle on it, also change src to data-src on the initial DOM so that non redirect is not automatically loaded.

<iframe id="myIframe" data-src="http://website.com:352/pictures/1">

The you can add the no redirect param on load

jQuery(function() {
  var $iframe = $("#myIframe");
  var src = $iframe.attr('data-src');
  $iframe.attr('src', src + "?noRedirect");
});
Sign up to request clarification or add additional context in comments.

1 Comment

This actually doesn't work. When I check the src of the iframe, it is the original, not the appended version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.