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

multiple instance of script #18

Open
pincash opened this issue Jun 20, 2016 · 1 comment
Open

multiple instance of script #18

pincash opened this issue Jun 20, 2016 · 1 comment
Labels

Comments

@pincash
Copy link

pincash commented Jun 20, 2016

Hello,

I am using plugin with joomla 3+
Its working well but I come to found one issue.
I have scripts in my tmpl pages for particular view.
Now When I go to say page contact.html scripts from my view added into head tag.
now I navigate to some pages and come back to contact.html page.
So the script from view again adding to head and creating multiple instance there.

If I am having some alert function in script then it will give alert multiple times.
How can I remove this issue?

Thanks,
Pinkesh

@Fedik
Copy link
Owner

Fedik commented Jun 20, 2016

it is normal behavior for fullajax,
fullajax run all code that attached to new page

you can check that you code run once with if, like:

if(!window.myCodeInstance){
  window.myCodeInstance = new MyCodeInstance();
}

@Fedik Fedik added the question label Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants