- Posts: 846
- Thank you received: 92
jquery noconflict manage in hks level
12 years 1 month ago - 12 years 1 month ago #169273
by lionel75
jquery noconflict manage in hks level was created by lionel75
hi
my jquery code using $ don't work now !!!
i see in the HTML client code this javascript code
"""""
if(hikaModule) hikaModule.innerHTML = result;
if(window.jQuery && typeof(jQuery.noConflict) == "function" && !window.hkjQuery) {
window.hkjQuery = jQuery.noConflict();
}
""""""
Q1 Can we interpret this code like " HKS create a new namespace for jquery of name hkjQuery "
Q2 If yes can we create another new namespace for another jquery library( not same version ) .
Q3 howto detect the namespace of jquery if $ is use by mootool ?
Q4 si there a good way to find which extension call / manage a specific javascript file ?
Q5 is there a way to not let HKS manage javascript conflict ?
regard's
my jquery code using $ don't work now !!!
i see in the HTML client code this javascript code
"""""
if(hikaModule) hikaModule.innerHTML = result;
if(window.jQuery && typeof(jQuery.noConflict) == "function" && !window.hkjQuery) {
window.hkjQuery = jQuery.noConflict();
}
""""""
Q1 Can we interpret this code like " HKS create a new namespace for jquery of name hkjQuery "
Q2 If yes can we create another new namespace for another jquery library( not same version ) .
Q3 howto detect the namespace of jquery if $ is use by mootool ?
Q4 si there a good way to find which extension call / manage a specific javascript file ?
Q5 is there a way to not let HKS manage javascript conflict ?
regard's
Last edit: 12 years 1 month ago by lionel75.
Please Log in or Create an account to join the conversation.
12 years 1 month ago #169288
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic jquery noconflict manage in hks level
Hi,
api.jquery.com/jquery.noconflict/
We store a pointer to the jQuery object so if something break the jQuery object or the "$" (like re-include mootools after), we still can access to the jQuery object thanks to our pointer.
The code is totally safe and does not break the "jQuery" or the "$", it is just a backup of the object (using a pointer).
If your code with $ does not work, use a lamba function with a " window.jQuery" parameter.
You should have an inclusion of mootools or maybe several inclusion of jQuery (which have the bad effect to destroy the previous jQuery point and lot the jQuery module loaded ; thanks to the hkjQuery, we can still have a backup of the previous loaded jQuery).
Q3. There is no way to detect that, you have to use lamba function with "window.jQuery" or "document.id".
Q4. Analyze the code
Regards,
api.jquery.com/jquery.noconflict/
We store a pointer to the jQuery object so if something break the jQuery object or the "$" (like re-include mootools after), we still can access to the jQuery object thanks to our pointer.
The code is totally safe and does not break the "jQuery" or the "$", it is just a backup of the object (using a pointer).
If your code with $ does not work, use a lamba function with a " window.jQuery" parameter.
You should have an inclusion of mootools or maybe several inclusion of jQuery (which have the bad effect to destroy the previous jQuery point and lot the jQuery module loaded ; thanks to the hkjQuery, we can still have a backup of the previous loaded jQuery).
Q3. There is no way to detect that, you have to use lamba function with "window.jQuery" or "document.id".
Q4. Analyze the code
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: lionel75
Please Log in or Create an account to join the conversation.
12 years 1 month ago #169354
by lionel75
Replied by lionel75 on topic jquery noconflict manage in hks level
Thank's for your reply
since my last post i answer to most of my questions by look at the code .
I discover where the mootool setting is locate in the joomla GUI BackEnd .
configuration -> display -> general display -> Image popup mode : mootool |shadowbox ( external ) |shadowbox embedded)
don't know if it make sense for many HKS users to be able to disable image popup but for how i use HKS i ll say yes )
HKS is really great and prevent incompatibilities ( it looks like AMD feature for javascript ) .
since my last post i answer to most of my questions by look at the code .
I discover where the mootool setting is locate in the joomla GUI BackEnd .
configuration -> display -> general display -> Image popup mode : mootool |shadowbox ( external ) |shadowbox embedded)
don't know if it make sense for many HKS users to be able to disable image popup but for how i use HKS i ll say yes )
HKS is really great and prevent incompatibilities ( it looks like AMD feature for javascript ) .
Please Log in or Create an account to join the conversation.
12 years 1 month ago #169355
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic jquery noconflict manage in hks level
Hi,
Yes we did our best to have HikaShop working even if the rest of the website had some javascript troubles.
That's why we have the hkjQuery, the "Oby" library, the integration with shadowbox.
We are looking for a good replacement for the classical popups (instead of the mootools lightbox or the bootstrap popup) ; but for the moment, I did not see something which fully convinced me.
Regards,
Yes we did our best to have HikaShop working even if the rest of the website had some javascript troubles.
That's why we have the hkjQuery, the "Oby" library, the integration with shadowbox.
We are looking for a good replacement for the classical popups (instead of the mootools lightbox or the bootstrap popup) ; but for the moment, I did not see something which fully convinced me.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.205 seconds