Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > Kentico with jQuery View modes: 
User avatar
Member
Member
marko-softing - 3/26/2009 4:26:10 AM
   
Kentico with jQuery
I have some problems with jQuery in Kentico i try to implement jScrollPane, but have a error in the function of jScrollPane.
<script type="text/javascript">
$(function() //get javascript excetion here(Error: Object expected)
{

$('.scroll-pane').jScrollPane({ showArrows: true, scrollbarWidth : 25 });
}
);</script>

So if some has expirience with Kentico and jQuery please help, because i copy the same code in a new Visual studio web site and it works perfect.

Thanks,

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 3/30/2009 3:45:03 AM
   
RE:Kentico with jQuery
Hi,

Could you please check the rendered code of the page?
What is rendered in the "!DOCTYPE" at the beginning? If it is XHTML, the problem could be caused when the jQuery is not validated correctly (e.g. due to the comments).
Is the jQuery script loaded correctly in the rendered code?
Could you please send us the whole code?

Thank you.

Best Regards,
Juraj Ondrus

User avatar
Member
Member
ayushc-newsmax - 4/13/2010 3:02:29 PM
   
RE:Kentico with jQuery
Was this issue solved?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/22/2010 2:17:15 AM
   
RE:Kentico with jQuery
Hi,

I have never heard back from this user, so I assume that this issue was solved.

Best regards,
Juraj Ondrus

User avatar
Certified Developer v6
Certified Developer v6
szarouski - 11/22/2011 8:46:00 AM
   
RE:Kentico with jQuery
Hi Juraj,
Here details of the issue in my case. I'm including jquery at the head section of the master page. Then I include another file at the bottom (before closing body) with code which use "$" as a function. Also on same page I use Kentico's Document library. And because of that Kentico load internal jquery again (maybe for library sorting). So at my bottom script - $ function is lost, meaning that something in Kentico's scripts is trying to clean up, but don't restore "$" back. On other pages, where I don't use Document library everything is fine (Kentico's jquery is not loaded as well). Please investigate. Let me know if you have any questions.

However at the bottom script I can still access "jQuery" function, so I can restore $ myself like this "$ = jQuery" or wrap code in this "(function($){/*your code*/}(jQuery))". If Kentico team will not fix it - please, at least give this recommendations on FAQs or somewhere else.

User avatar
Certified Developer v6
Certified Developer v6
szarouski - 11/22/2011 8:47:04 AM
   
RE:Kentico with jQuery
Forgot to mention that I'm using Kentico 6

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 11/28/2011 3:33:34 AM
   
RE:Kentico with jQuery
Hi,

This will be changed in the upcoming version 7. Right now, in the way you are using it, you can get conflicts with MooTools scripts. The recommended way right now is to use the jQuery functions directly and not through "$" sign.

We are sorry for this inconvenience.

Best regards,
Juraj Ondrus

User avatar
Member
Member
positivepurchasing - 11/23/2012 10:10:52 AM
   
RE:Kentico with jQuery
Hi,

Was this fixed in version 7?

Cheers
Paul

User avatar
Kentico Customer Success
Kentico Customer Success
kentico_martind2 - 12/3/2012 2:56:25 AM
   
RE:Kentico with jQuery
Hi Paul,

Unfortunately not, it's planned for v8.

Best regards,
Martin Danko

User avatar
Member
Member
positivepurchasing - 12/4/2012 3:19:38 AM
   
RE:Kentico with jQuery
Hi Martin,


OK, never mind, using 'jQuery' instead of '$' is fine.


Cheers
Paul