FullAJAX icon indicating copy to clipboard operation
FullAJAX copied to clipboard

multiple instance of script

Open pincash opened this issue 9 years ago • 1 comments

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

pincash avatar Jun 20 '16 09:06 pincash

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 avatar Jun 20 '16 19:06 Fedik