0

I've been trying to make a window like iframe that has a go back and go forward button, here's a bit of code that I used:

BackButton.onclick = function() {
    Iframe.contentWindow.history.go(-1); 
}
BackButton.onclick = function() {
    Iframe.contentWindow.history.go(1); 
}

The problem is that the cross-origin policy doesn't allow this, it gives me this error message:

SecurityError: Blocked a frame with origin "[origin]" from accessing a cross-origin frame.

Can somebody help me to get past this error?

0 Answers0