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

Unable to access ouibounce function in a static .js file #148

Open
chakanish opened this issue Feb 2, 2021 · 0 comments
Open

Unable to access ouibounce function in a static .js file #148

chakanish opened this issue Feb 2, 2021 · 0 comments

Comments

@chakanish
Copy link

Hi,

I am trying to use this library in a snippet code that is hosted as a static .js file in a cdn share.

this script is imported by several other 3rd party websites.

I am using the below code in the static .js file.

// ouibounce script load
var ouibounceScript = document.createElement("script");
ouibounceScript.src =
"https://cdnjs.cloudflare.com/ajax/libs/ouibounce/0.0.12/ouibounce.js";
document.head.appendChild(ouibounceScript);

var modal = ouibounce(document.getElementById("widget-view"));
modal.fire();

However this is throwing me an error stating ouibounce is not defined

Can you please help?

Thanks.

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

1 participant