I have a page with dynamic data loaded by some ajax and lots of javascript.
the page contains a list from which the user can choose and each selected value loads n
The accepted answer does not seem to work if you try to set a cross-domain URL for the IFrame. As a workaround, I detached the IFrame from the DOM before setting the src (using jQuery).
// remove IFrame from DOM before setting source,
// to prevent adding entries to browser history
var newUrl = 'http://www.example.com';
var iFrame = $('#myIFrame');
var iFrameParent = iFrame.parent();
iFrame.remove();
iFrame.attr('src', newUrl);
iFrameParent.append(iFrame);