Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onload in iframe.contentWindow is not working ? #242

Closed
liyoung1874 opened this issue Dec 22, 2023 · 4 comments
Closed

onload in iframe.contentWindow is not working ? #242

liyoung1874 opened this issue Dec 22, 2023 · 4 comments

Comments

@liyoung1874
Copy link

// window is Window object, so
window.onload = () => {
    // This is working
}

// In this document, has a iframe, so
const iframe = document.getElementById('#myIframe')
const iframeWindow = iframe,contentWindow
// iframeWindow is Window object too.

iframwWindow.onload = () => {
    // This is not working.
}

Why is this ? Can explain ?

Thanks so much.

@teoli2003
Copy link
Member

Are you sure the dom is loaded when you call this. And that getElementById worked?

Also there is an incorrect comma in the declaration if iframeWindow.

Is it code copy-pasted from an example? If so which one?

@liyoung1874
Copy link
Author

liyoung1874 commented Dec 22, 2023

Hello, this case is happening in my work.
This code is my handwrite.

That incorrent comma and selector is my fault. Sorry.

Attach screenshot:

  1. html
    image
  2. js (vue)
    image
  3. debug log
    image
  4. my brower version
    image

Finally, please forgive my English expression.

@teoli2003
Copy link
Member

Sorry, I can't help you more, I don't know about Vue.

You may bring them of a Vue support forum.

We are short in ressources so we cannot do support, but thanks for thinking about us. I'll close this issue.

@teoli2003 teoli2003 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 22, 2023
@liyoung1874
Copy link
Author

Thanks for your patient.

But i queit want to know the answer to this question.

So, i use another way to test the case.

There is screenshot.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants