javascript - jQuery & Bootstrap not working? - Stack Overflow

I have recently started usinglearning bootstrap and jQuery for my site and while I was searching for i

I have recently started using/learning bootstrap and jQuery for my site and while I was searching for ideas. I went across bootstrap dialogs which I thought could help me make my site more modernized. While I was testing code snippets it in the site. There seemed to be no response from jquery at all.

<li id="Login"><a href="#">Login</a></li>

This li tag above is being printed out by php. The code below is placed in the body tags

<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>

<script>
$(document).ready(function(){
    $("#Login").click(function(){
        BootstrapDialog.show({
        message: 'Hi Apple!'
    });
    });
});
</script>

code samples are very much appreciated if there was an error because I don't really know what I am doing wrong.

EDIT: I forgot to mention that i got the snippets from

I have recently started using/learning bootstrap and jQuery for my site and while I was searching for ideas. I went across bootstrap dialogs which I thought could help me make my site more modernized. While I was testing code snippets it in the site. There seemed to be no response from jquery at all.

<li id="Login"><a href="#">Login</a></li>

This li tag above is being printed out by php. The code below is placed in the body tags

<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>

<script>
$(document).ready(function(){
    $("#Login").click(function(){
        BootstrapDialog.show({
        message: 'Hi Apple!'
    });
    });
});
</script>

code samples are very much appreciated if there was an error because I don't really know what I am doing wrong.

EDIT: I forgot to mention that i got the snippets from http://nakupanda.github.io/bootstrap3-dialog/#available-options

Share Improve this question edited May 22, 2015 at 7:19 Deep Kakkar 6,3054 gold badges43 silver badges80 bronze badges asked May 22, 2015 at 6:27 DeathKingDeathKing 3113 silver badges17 bronze badges 5
  • 1 do you get any errors in console? make sure you have jquery.js and bootstrap.min.js inside js/ directory – Praveen Puglia Commented May 22, 2015 at 6:29
  • I got snippets from w3schools and they seemed to work fine for me and those files are correctly placed in their respective directories – DeathKing Commented May 22, 2015 at 6:31
  • 1 Check error in browser console – A. Wolff Commented May 22, 2015 at 6:33
  • I have searched on how to check jquery errors and i seemed to have gotten one error which is "Uncaught ReferenceError: BootstrapDialog is not defined".. How to fix this error? – DeathKing Commented May 22, 2015 at 6:36
  • can you show you own libraries? maybe need to fix how you call you libraries... – ccdiego5 Commented May 22, 2015 at 13:12
Add a ment  | 

2 Answers 2

Reset to default 8

You have not included bootstrap-dialog.js.

I tried running your code into jsfiddle and it gave me ReferenceError: BootstrapDialog is not defined

you can find bootstrap-dialog-js on nakupanda's github account : https://github./nakupanda/bootstrap3-dialog/tree/master/src/js

Replace your code like this and show me the result

    <script>
$(document).ready(function(){
$("#Login").on('click', function(event){
    BootstrapDialog.show({
    message: 'Hi Apple!'
    });
});
});

</script>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744406267a4572649.html

相关推荐

  • javascript - jQuery &amp; Bootstrap not working? - Stack Overflow

    I have recently started usinglearning bootstrap and jQuery for my site and while I was searching for i

    6天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信