View Single Post
Old 12-09-2012, 01:24 PM   PM User | #8
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
You could play with the following. But, erm...., it's not quite working?! Added: actually, I think it is working, if uploaded to a server.

Code:
<!DOCTYPE html>
<html>
<head>
    <title>Page Title</title>

<script>
    var thePasswordAddress = "not_carousel.html";
    window.onload = function () {
        var oIframe = document.getElementById("secretIframe");
        oIframe.onload = function () {
            // for compatibility
            var oDoc = oIframe.contentWindow || oIframe.contentDocument;
            if (oDoc.document) {
                oDoc = oDoc.document;
            }
            var newLoc = oDoc.location.href;
            //console.log(oDoc);
            alert(newLoc);
            if (newLoc.indexOf(thePasswordAddress) + 1) {
                alert('Yes, it is the correct page!');
            } else {
                // 404 - out of luck!
                alert('Doh! Not found!');
                window.location = "dragto.html";
            }
        };
        oIframe.src = "carousel.html";
    };

</script>
</head>
<body>
<h1>Just a Heading</h1>
<iframe id="secretIframe">Hello</iframe>

</body>
</html>
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS

Last edited by AndrewGSW; 12-09-2012 at 01:31 PM..
AndrewGSW is offline   Reply With Quote