javascript - twitter bootstrap + grails kickstart breaks jquery -


I'm using grails kickstart to add twitter bootstrap to my app and it's causing problems with jquery libraries I can not work on the DOM object:

What I found:

  & lt; Script & gt; $ (Function () {// page load $ .post ('$ {createLink (controller:' function ', action:' create ')}', loads function (data) {$ ('# AndersonModal') Model ();}, "html"); $ ('#othermust'). Click (function () {console.log ("Modal button clicked"); $ ('# AndersonModal') Model ('show');});}); & Lt; / Script & gt; & Lt; An id = "andersonTest" href = '#' & gt; Anderson & lt; / A & gt; & Lt; Div id = "Anderson model" class = "model feed" tabindex = "- 1" role = "dialog" area-libelibil = "mymodel label" axia-hidden = "true" & gt; & Lt; / Div & gt;   

When I click on the link, it sets the JS fire, but says that the 'modal' function is not

  TypeError: $ (. ..) Modal is not a function 1: 129 blank string getElementById () passed bundle-bundle_bootstrap_defire.js: 4 "modal button clicked"   

Although everything works Does the modal work, I can not use JS to reveal them ... In fact it is happening any way With a library that adds a function to a DOM object such as $ ('# someID'). SomeFunction (); This is always the same error:

  "Type error: $ (...). There is no function function"   

Does anyone Is there any idea about it that I can solve it?

Plug-in on my app:

  plugins {build ": tomcat: 7.0.52.1" compile ": scaffolding: 2.0.3" compilation ": cache: 1.1. 2.0 'Compilation': Spring-Security-Core: 2.0-RC4 'Compilation': Mail: 1.0.6 "Compilation": Kickstart-K-Bootstrap: 1.1.0 "Compilation": Rest: 0.7 "Compilation": ModernVijay: Latest integration "compile": Uploader: 0.8.2 "Compilation": Quartz: 1.0.1 "// latest. Integration" // 1.0.1 "Runtime": Hibernate: 3.6.10.13 "//": Hibernate4: 4.3.5.1 "runtime": database-migration: 1.4.0 "runtime": jquery: 1.11.0.2 "runtime": resource: 1.2.7 "runtime": spring-protection-A Iel: 2.0-RC 1 '}   

Edit:

Modules used:

  & lt; G: javascript src = "fastclick.js" /> & Lt; R: module requirement = "jquery" /> & Lt;% - jQuery is required for Bootstrap! -% & gt; & Lt; R: Module Required = "Bootstrap" /> & Lt; R: module requirement = "bootstrap_utils" /> & Lt; R: layout processing / & gt; & Lt; G: layoutHead / & gt;    

I found out that this is due to a conflict because more than one jQuery version Is happening So I need to use it to solve:

  $ ('#otherstest'). Click (function () {$ 2 = jQuery.noConflict (true); console.log ("Model button clicked"); $ 2 ('# Anderson Model'). Model ('show');});    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -