Where does CB load jQuery

12 years 9 months ago #169522 by sushantt
Where does CB load jQuery was created by sushantt
Hi,
I tried to search for an answer to this question on the forum , but I was unable to find a clear cut answer. Can anyone please let me know where does CB load the jQuery 1.5.0 file (the PHP code location).

This is pretty important, I have tried to go through the code w/o success please please let me know the location.

Thanks a lot in advance.
-Sushant

Please Log in to join the conversation.

12 years 9 months ago #169571 by krileon
Replied by krileon on topic Re: Where does CB load jQuery
We can't advise you on core edits, which is likely why you never found results. CB needs to load its library as necessary when something calls the jQuery API. You can not remove or change this, sorry.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: sushantt

Please Log in to join the conversation.

12 years 9 months ago #169639 by sushantt
Replied by sushantt on topic Re: Where does CB load jQuery
Hi Kyle,
I am not trying to edit the core files neither am I seeking advice/support for it, I just want to understand the program structure better so that I can modify my own files accordingly.

If I know where the CB loads its jQuery, or how it loads it, I can organise the loading of my JS scripts (in my own component accordingly).

In the true spirit of an open source system, there should be no problem in giving me what I seek, a little hint into the source code.

Thanks again,
Sushant

Please Log in to join the conversation.

12 years 9 months ago #169665 by krileon
Replied by krileon on topic Re: Where does CB load jQuery

I am not trying to edit the core files neither am I seeking advice/support for it, I just want to understand the program structure better so that I can modify my own files accordingly.

Well then I see absolutely no reason not to tell you. :)

administrator/components/com_comprofiler/plugin.foundation.php

In class "CBframework" as function "outputCbJQuery".

If I know where the CB loads its jQuery, or how it loads it, I can organise the loading of my JS scripts (in my own component accordingly).

I see, CB does not output static jQuery. It's all done dynamically and added to the head by integrations. If going to load your own jQuery it's best to check if jQuery already exists before adding it. This can all be done with a relatively small amount of JS as follows.
if ( typeof jQuery == 'undefined' ) { 
	var head = document.getElementsByTagName( 'head' )[0];

	script = document.createElement( 'script' );
	script.id = 'jQuery';
	script.type = 'text/javascript';
	script.src = 'js/jquery.js';

	head.appendChild( script );
}

With the above you'd just adjust the SRC accordingly.

In the true spirit of an open source system, there should be no problem in giving me what I seek, a little hint into the source code.

Certainly, it's not a problem at at all depending on the intentions. We don't advise users on core edits because it's counter productive to advise them on how to break our own software then they come back needing help because XYZ doesn't work anymore. :P


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: sushantt

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.235 seconds

Facebook Twitter LinkedIn