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

  • Home
  • SEARCH
  • 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 6662655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:24:47+00:00 2026-05-26T02:24:47+00:00

I not know why not my ajax call on my function, did you can

  • 0

I not know why not my ajax call on my function, did you can help me?

Example: http://jsfiddle.net/MaGyp/7/

function myalert() {
    var result = true;
        //var hide = $('.alert').fadeOut(100);
        //var css = $('#appriseOverlay').css('display','none');
        var $alertDiv = $('<div class="alert">Do you want to delete this item?<button class="ok">ok</button><button class="cancel">cancel</button></div>');
        $('body').append($alertDiv);
        $('.ok').click(function () {
            $('.alert').fadeOut(100);
            $('#appriseOverlay').css('display','none');
            callback(true);
        });
        $('.cancel').click(function () {
            $('.alert').fadeOut(100);
            $('#appriseOverlay').css('display','none');
            callback(false);
        });
        $alertDiv.fadeIn(100);
        $('#appriseOverlay').css('display','block');
    return result;
    };

$('.iu').click(myalert)
function callback(result) {
    //
    if(result){
        alert(result);
        $('.image_upbg').each(function(){$(this).removeClass().addClass(unique())});
        var get_class = '.'+$(this).closest('div').attr('class');
        var get_val = $(this).closest('a').find('input').attr('value');
        //alert(get_val);
        var val = 'val_upimg1=' + get_val;
        $(get_class).fadeOut('slow');
          $.ajax({
                type: "POST",
                dataType: 'json',
                url: 'delete_upimg',
                data: val,
                cache: false,
                success: function (data) {
                        $(get_class).fadeOut('slow');
                },
                "error": function (x, y, z) {
                    // callback to run if an error occurs
                    alert("An error has occured:\n" + x + "\n" + y + "\n" + z);
                }
       });
    }else{
        alert('no')
    }
}
  • 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-05-26T02:24:47+00:00Added an answer on May 26, 2026 at 2:24 am

    this two lines causes problems

       var get_class = '.'+$(this).closest('div').attr('class');
       var get_val = $(this).closest('a').find('input').attr('value');
    

    please add more html to your fiddle, or is it all?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you do not know what Pipe Viewer is (I did not know about
I faced a little trouble - I do not know if I can define
To recap for those .NET gurus who might not know the Java API: ConcurrentHashMap
I have 3 ajax call in one function and checkAjaxCompletion which checks each ajax
Getting sick with asp.net permission madness... This time, I Just cant AJAX-CALL any kind
I have successfully implemented django-ajax-uploader into my project. But I do not know how
I am using .Net framework 2.0 / jQuery to make an Ajax call to
I have this function in charge of making a ajax call, and based on
Having some difficulty using a variable within an ajax() function. I know it is
I want to call some javascript functions after all ajax calls. I know how

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.