Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Alert box issue

  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question Alert box issue

    Hey guys,

    So I'm new to JavaScript etc. and at the moment I'm attempting to add a alert box which should fade in and out on pressing of the close button. The alert box appears however when clicking the cross nothing happens.

    I'm using Bootstrap as a framework for this and have no idea how to get this to work.

    http://twitter.github.com/bootstrap/...pt.html#alerts

    So I've added the appropriate HTML code for the box to show however I really have no clue as to how I link in the JS files as it seems to fail whenever I try to do so.

    Any ideas on where/what should be done in regards to the JavaScript?

    Current code section:

    Code:
    <div class="bs-docs-example">
              <div class="alert alert-block alert-error fade in">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <h4 class="alert-heading">Oh snap! You got an error!</h4>
                <p>Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
                <p>
                  <a class="btn btn-danger" href="#">Take this action</a> <a class="btn" href="#">Or do this</a>
                </p>
              </div>
    Just the JavaScript I need help with :S.
    Last edited by spudmonkee; 10-12-2012 at 11:10 PM.

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    did you donwload the jQuery and bootstrap files and put them on your web server?

    did you link them in the head section of yoru page like something like this?

    Code:
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script src="js/bootstrap.min.js"></script>

  • Users who have thanked DanInMa for this post:

    spudmonkee (10-12-2012)

  • #3
    New Coder
    Join Date
    Sep 2012
    Posts
    16
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by DanInMa View Post
    did you donwload the jQuery and bootstrap files and put them on your web server?

    did you link them in the head section of yoru page like something like this?

    Code:
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script src="js/bootstrap.min.js"></script>
    I didn't link the http://code.jquery.com/jquery-latest.js, noobs.

    Anyways thank you!

  • #4
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    Quote Originally Posted by spudmonkee View Post
    I didn't link the http://code.jquery.com/jquery-latest.js, noobs.

    Anyways thank you!

    no problem. I'm one of the many many people that posted asking how to show and hide a div once, even though there are a million examples out there . I think we learn more from failure than sucess, so it only gets better!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •