When I developed a FB application, I tried to get the canvas used javascript like below:
Work
document.getElementsByTagName('iframe')[1].id
//Output: iframe_canvas
Not Work
window.frames[1].id
//Output: undefined
I don't know why, after that I looked for the answers on SO, I found the answer and comment for my issue.
But, I really don't understand why
:
You can't use "window.frames" if your IFRAME was created programmatically, only if it is declared in the HTML page source. Src @Tomalak's comment