Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I use some Bootstrap template with my struts2 applicaion :

http://www.bootstrapzero.com/bootstrap-template/adminlte

that uses these files :

https://github.com/almasaeed2010/AdminLTE/tree/master/js/AdminLTE

I want to integrate some javascript code to my jsp page :

<script>
$(document).ready(function(){

//javascript code     
    });

</script>

the new code does not work with the use of these files:

 <!-- AdminLTE App -->
        <script src="<c:url value="page/js/AdminLTE/app.js"/>" type="text/javascript"></script>

        <!-- AdminLTE dashboard demo (This is only for demo purposes) -->
        <script src="<c:url value="page/js/AdminLTE/dashboard.js"/>" type="text/javascript"></script>

However the script works fine if I not call them in my code; how can i resolve this problem please !

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
174 views
Welcome To Ask or Share your Answers For Others

1 Answer

This might be a jQuery conflict. Try using the noConflict in jQuery like this:

var $j = jQuery.noConflict();

Then your script will look like this:

<script>
var $j = jQuery.noConflict();    

$j(document).ready(function(){

//javascript code     
});

</script>

Hope this helps!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...