Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-12-2012, 10:09 PM   PM User | #1
spudmonkee
New Coder

 
Join Date: Sep 2012
Posts: 16
Thanks: 4
Thanked 0 Times in 0 Posts
spudmonkee is an unknown quantity at this point
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..
spudmonkee is offline   Reply With Quote
Old 10-12-2012, 10:49 PM   PM User | #2
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
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>
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Users who have thanked DanInMa for this post:
spudmonkee (10-12-2012)
Old 10-12-2012, 11:09 PM   PM User | #3
spudmonkee
New Coder

 
Join Date: Sep 2012
Posts: 16
Thanks: 4
Thanked 0 Times in 0 Posts
spudmonkee is an unknown quantity at this point
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!
spudmonkee is offline   Reply With Quote
Old 10-12-2012, 11:24 PM   PM User | #4
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
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!
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:12 AM.


Advertisement
Log in to turn off these ads.