Question

This is a shot in the dark, but is it possible to update the page title of a canvas app using Javascript? While the page title does seem to reflect the app, is it possible to update it once the page has rendered?

I'd like to be able to add an active counter to the title (e.g. "(0) Title", "(1) Title", "(2) Title") based on what's happening in the app, which doesn't seem possible from within an iframe.

[edit] Document.title obviously doesn't work since it's applied to my page. But I've also tried parent.document.title and that doesn't work either.

Était-ce utile?

La solution

To access the parent window you need something like: parent.document.title

But this is NOT allowed for obvious reasons:

  1. Facebook won't allow you to access their page (document)
  2. Read about Cross Domain Communications & Same origin policy (there are suggested workarounds but I don't think Facebook will allow them either)

Anyway, if you try the code above you'll get (as expected):

Permission denied to access property 'document'

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top