Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:54:44+00:00 2026-06-09T04:54:44+00:00

Here is my html for alerts <div id=feature class=feature> <div id=alerts> </div> # other

  • 0

Here is my html for alerts

<div id="feature" class="feature">
    <div id="alerts">
    </div>
    # other html data
</div>

Here is my Ajax call

        // send the data to the server using .ajax() or .post()
        $.ajax({
            type: 'POST',
            url: 'addVideo',
            data: {
                video_title: title,
                playlist_name: playlist,
                url: id,
                success: notify('success', 'saved!')
                error: notify('failure', 'not saved!')
            },

Here is how notify function looks

function notify(notify_type, msg) {
    var alerts = $('#alerts');
    alerts.append('<a class="close" data-dismiss="alert" href="#">×</a>');
    if (notify_type == 'success') {
      alerts.addClass('alert alerts-success').fadeIn('fast');
    }
    if (notify_type == 'failure') {
      alerts.addClass('alert alerts-error').fadeIn('fast');
    }
}

I am using reference from here – http://twitter.github.com/bootstrap/components.html#alerts
When I debug on Firebug, I see No elements were found with the selector: “#alerts”
Although I can see the div tag in view-source, what must be wrong?

Needed
– Based on response I would like to insert appropriate alert in text automatically

I am learning jQuery and I am sure this has error, but not able to understand where this is failing

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:54:48+00:00Added an answer on June 9, 2026 at 4:54 am

    There are some errors in your ajax function, you have put the success function within the object and missed a ), try the following:

        $.ajax({
            type: 'POST',
            url: 'addVideo',
            data: {
                video_title: title,
                playlist_name: playlist,
                url: id },
            success: notify('success', 'saved!'),
            error: notify('failure', 'not saved!')
            })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following example: ( live demo here ) HTML: <div class=board> <div class=row>
Fiddle is here - http://jsfiddle.net/ashwyn/a45ha/ HTML here - <div class=parent> <div class=a>Class A</div> <div
I have html like so: <div class=foo> (<a href=forum.example.com>forum</a>) <p> Some html here.... </div>
Here is my HTML: <tr> <td colspan=2 class=borderBottomCell> <div class=benefitInfo style=WIDTH: 99%! important;> <asp:DropDownList
Here is my HTML: <div id=leftMenuWrapper> <div id=ramps class=leftMenuHeaderButton></div> <div id=carServiceRamps class=leftMenuSubButton></div> <div class=clear></div>
Here is my HTML: <li> <div class=menu_inner> <a href=#> <div class=button><img class=486 src=images/portalbutton.png /></div>
With a function a div-popover gets called and filled with dynamic data using Ajax,
I'm using Twitter Bootstrap. The alert HTML code is: <div class=alert alert-block> <a class=close
Here's my HTML. Apologies for formatting - this is my first-ever question! <div id=Template>
Here in this html i need to get the image name arrow_down using jquery

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.