-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Argument error in iframes #722
Comments
I forgot to quote! The import is done in a given HTML body and the access by an iframe. I'm using the expression "parent.swal", which in the old version works, but not in this new one, returning the error. |
Here the same problem. Please fix that. edit: It happens only on extended configurations. Alerts like the following does work: |
I'm also affected. I've a workaround. Define a function like this in your parent:
and call this function from the iframe. |
Any news? I noticed other users with the same problem. More information (tested in version 2.0): The reference (import) of the library is in the main body of the page and I'm calling the SweetAlert function on a button that is inside an iframe. Image This is running: mainSystemFrame.swal ("Oops", "Something went wrong!") However, it does not run when I use the "extended" call: mainSystemFrame.swal ("Are you sure you want to do this?", {
buttons: ["Oh noez!", "Aww yiss!"]
}); The error generated is:
|
It does not solve when using premises. Ex: swal("Click on either the button or outside the modal.")
.then((value) => {
swal('The returned value is: ${value}');
}); |
I've done some digging and think I found the cause of this bug: When On the other hand, when used outside of an iframe (or the console), This results in Apparently Object prototypes are different in different frames, @t4t5 do you know more about this? PRs are welcome 😃 |
Hi, If someone still has a similar problem i've made like @jordeu but with some changes tha allows use o promises Ex: |
Hi, my dear!
I use SweetAlert in a project, but I noticed that there were some changes.
Before, I imported a JS file and a CSS into the body of HTML. I downloaded the latest "sweetalert.min.js" file and imported it as before but I'm having trouble using it.
The call below runs successfully:
But this other:
... the following error occurs:
I'm doing something wrong?
The text was updated successfully, but these errors were encountered: