Keyword

K2 keep loading a LOT of scripts. WHY?

  • DINALVA ROMANCINI
  • DINALVA ROMANCINI's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 9 months ago - 11 years 9 months ago #108465 by DINALVA ROMANCINI
K2 keep loading a LOT of scripts. WHY? was created by DINALVA ROMANCINI
I don't know... I customize my template to work ONLY with jquery, and I load jquery form google ajax library.

But anyway K2 load all this files:

<script src="/media/jui/js/jquery.min.js" type="text/javascript"></script>
<script src="/media/jui/js/jquery-noconflict.js" type="text/javascript"></script>
<script src="/media/k2/assets/js/k2.noconflict.js" type="text/javascript"></script>
<script src="/components/com_k2/js/k2.js" type="text/javascript"></script>
<script src="ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js">
<script src="/components/com_dmk2articlesfilter/lib/jquery_noconflict.js" type="text/javascript"></script>
<script src="ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js">
<script src="/media/jui/js/bootstrap.min.js" type="text/javascript"></script>

I pass 1 week looking at the code of com_k2 for those lines that call JS and It impossible to find.

Please, this amount of js are messing all the page. Also, why K2 load 3 times (3 TIMES) noconflict code? anyway I'm not using mootools anymore

Where I can remove this code??

Regards!

Please Log in or Create an account to join the conversation.

  • DINALVA ROMANCINI
  • DINALVA ROMANCINI's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 9 months ago #108466 by DINALVA ROMANCINI
Replied by DINALVA ROMANCINI on topic Re: K2 keep loading a LOT of scripts. WHY?
The K2.js is clearly coded in jquery...

so WHY the need of no-conflict?

Also, If I call jquery by google library... why call the jquery again?

Please, somebody can give me a hand? :silly:

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago - 11 years 8 months ago #108467 by Stonedfury
Replied by Stonedfury on topic Re: K2 keep loading a LOT of scripts. WHY?
I have had the same problem. I can't seem to locate where the code is actually being spit out from. The only solution I could find that has worked, at least so far, is jqueryeasy. I have it loading the current jquery that my sites template uses, and removing anything extra that k2 has added. It even removes the mootools and so far reorganizes the scripts to be more friendly. You can load external or internal files and remove extra junk you don't like. Click the help to see what it did.

Note: I did try to disable the k2 jquery using the parameters and it didn't do a thing. See image.

I removed
/media/k2/assets/js/k2.noconflict.js
/components/com_k2/js/k2.js
Attachments:

Please Log in or Create an account to join the conversation.

More
11 years 8 months ago #108468 by Stonedfury
Replied by Stonedfury on topic Re: K2 keep loading a LOT of scripts. WHY?
When I removed /components/com_k2/js/k2.js the article voting was broke so I just allow it to load and seems to not break anything.

Please Log in or Create an account to join the conversation.

  • DINALVA ROMANCINI
  • DINALVA ROMANCINI's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 8 months ago #108469 by DINALVA ROMANCINI
Replied by DINALVA ROMANCINI on topic Re: K2 keep loading a LOT of scripts. WHY?
StonedFury thanx for the response. Is rly hard to find the way to make K2 work well with only Jquery.

Finally I make K2 to not load noconflict, jquery and k2.js.

In the last version (2.6.3) K2 force the not load of jquery.

For the others I go to "plugins/system/k2/k2.php" and I comment the first piece of code that calls JS.

I'm not using Mootools (never again but anyway), so I move all the k2.js code to my personal script in Jquery. The only code that not work is the rating system, rly don't know why?

I'm waiting if anybody can help me on this

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum