fatkatie Posted July 25, 2017 Share Posted July 25, 2017 I have 'launched' an iframe from index.php. Index.php defines: <title>Admin Panels</title>. Within this iframe I access other pages with onClick. The function called looks like: function adminPanelRedirect(gotoHere) { switch (gotoHere) { .... document.location.href='http://news/administration/adminpanel3.php'; How can I change the title to 'Panel 3'. I've tried various DOM paths with window. and document. but I can't seem to get it done. window.frameElement.title returns the current one, but I can't change it. I don't want to use jQuery. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/ Share on other sites More sharing options...
requinix Posted July 25, 2017 Share Posted July 25, 2017 Try window.top.document.titleBut are you sure you should be using iframes? If the parent and the frame have to talk to each other that way then it sounds like you shouldn't be using iframes. Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/#findComment-1548881 Share on other sites More sharing options...
fatkatie Posted July 25, 2017 Author Share Posted July 25, 2017 I should have done my iframe 101 before posting. I'll get back. The point to all this is to hide all the admin pages URLs. It works very well except for the titling/branding. I wound up using js because the anchors exposed addresses defined in href. Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/#findComment-1548885 Share on other sites More sharing options...
requinix Posted July 25, 2017 Share Posted July 25, 2017 You know this doesn't actually hide the URLs though, right? I mean, any user can find out really easily what they are. And any links in the frame will be visible to the user too. 1 Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/#findComment-1548889 Share on other sites More sharing options...
fatkatie Posted July 25, 2017 Author Share Posted July 25, 2017 (edited) So I just discovered. btw - window.parent.document.title = 'some title'; this hiding business looks like a full blown ajax exercise. Damn. Thanks again. -- update. I'll just use the server. Forget hiding anything. I read it isn't worth it.. and I believe it. Edited July 25, 2017 by fatkatie Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/#findComment-1548890 Share on other sites More sharing options...
requinix Posted July 25, 2017 Share Posted July 25, 2017 this hiding business looks like a full blown ajax exercise. Damn.AJAX makes it a little harder but still won't hide the URL. Spoiler: there's nothing you can do to win this. All you can do is try to make it harder, but really you're just wasting time that could be better spent on other tasks. 1 Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/#findComment-1548891 Share on other sites More sharing options...
fatkatie Posted July 26, 2017 Author Share Posted July 26, 2017 Yah know.... I should be asking things like... "What do think about doing this?". I think there is a design forum in here. Security thru obfuscation? What was I thinking? You are correct.. It was abandoned. Aside. I would have thought, however, an ajax solution would work. It would expose the server side support file and the hosting page; but that's it. Correct? Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/#findComment-1548934 Share on other sites More sharing options...
requinix Posted July 27, 2017 Share Posted July 27, 2017 It would expose the server side support file and the hosting page; but that's it. Correct?It exposes everything that is part of the request and the response. That's the full URL for the request (domain name, path, query string), any POSTed data sent with the request, and whatever data is returned in the response. Which is what happens with regular requests and responses anyways. Quote Link to comment https://forums.phpfreaks.com/topic/304412-iframe-change-title-of-page-within/#findComment-1548939 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.