Jump to content

iframe; change title of page within


Recommended Posts

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.

 

Link to post
Share on other sites

Try

window.top.document.title
But 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.
Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

  • Like 1
Link to post
Share on other sites

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 by fatkatie
Link to post
Share on other sites

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.

  • Like 1
Link to post
Share on other sites

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?

Link to post
Share on other sites

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.
Link to post
Share on other sites
This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.