django-cms and jQuery -
i've got django site running quite happily django-cms want include of own fancy javascript using jquery. i'm rather new django, problems might stem this.
django-cms uses jquery itself, , if add jquery header - things break rathter unsurprisingly. how add own jquery without affecting django-cms?
at moment javascript files stored in media root i've defined in projects settings.py and, mentioned, reference them in header.
as read this, seems silly question, i'm still perplexed.
edit::some code
i have media root defined:
media_root = os.path.join(project_path, 'media')
and in base template header includes
<script src="/media/javascript/jquery.js" type="text/javascript"></script> <script src="/media/javascript/application.js" type="text/javascript"></script>
javascript in application.js works, when django-cms stuff breaks. example, trying add plugin placeholder results in:
uncaught typeerror: property 'type' of object function ( selector, context ) { // jquery object init constructor 'enhanced' return new jquery.fn.init( selector, context ); } not function
i assumed because 2 jquerys conflicting each other
::another edit:: should add i'm using django host static files because still in development...
a simple solution: keep jquery library in header , place other js @ boottom of page, right before </body>
. in case in admin mode, jquery lib overrided admin's copy, , of code added it.
Comments
Post a Comment