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 6625219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:44:50+00:00 2026-05-25T21:44:50+00:00

Anything I’m missing with the code below? I’m a bit overwhelmed. $(a[id^=’submitspam’]).click(function () {

  • 0

Anything I’m missing with the code below? I’m a bit overwhelmed.

$("a[id^='submitspam']").click(function () { 
    var thisForm = $(this).attr('id');
    var com_id = $(this).attr('id').substring(11);
    var thisFormFull = '#' + thisForm;

    $.ajax({  
        type: "POST",
        url: "/songs/spam.php",
        data: "command=mark_spam&cid=" + com_id,

        complete: function(data){
            messageList = 'contentspam-' + com_id;
            $('span#' + messageList).html(data.responseText);
            $(thisFormFull).hide();
            $('span#' + messageList).fadeIn();
        }
    });

    return false;  
});
  • 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-25T21:44:51+00:00Added an answer on May 25, 2026 at 9:44 pm

    Works for me. I created a jsfiddle with your code, and clicking the link in IE 8 generates a request. I used Fiddler to inspect the HTTP request:

    POST /songs/spam.php HTTP/1.1
    x-requested-with: XMLHttpRequest
    Accept-Language: en-US,en;q=0.7,es;q=0.3
    Referer: http://fiddle.jshell.net/josh3736/Ghy5C/show/
    Accept: */*
    Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Zune 4.0; .NET CLR 1.1.4322; .NET4.0C; InfoPath.3)
    Host: fiddle.jshell.net
    Content-Length: 23
    Connection: Keep-Alive
    Pragma: no-cache
    
    command=mark_spam&cid=1
    

    Even though the AJAX request 404s (there’s no spam.php on jsfiddle’s server), the link is hidden after the request completes. As an aside, you should make your callback function the success callback rather than the complete callback, so that your UI does not report that an operation succeeded when in fact there was an error.

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

Sidebar

Related Questions

See anything wrong with this? $.ajax({ url: '/nav/side', data: urlpath= + urlpath, success: function(data)
Is anything wrong with this code? <?php $variable = ; if (isset($variable)) { echo
Is there anything wrong with this code? My entity is not getting updated. public
Is there anything wrong in function shown below. The only bug that I found
Anything I have tried didn't work. Currenly I have following code to change asp.net
Has anything useful come out of Intentional or Language Oriented Programming? This isn't a
Anything wrong with this in general? CallingFunction() { CreatePipe() CreateMutex() CreateThread( ThreadFunction ) while(there
I did not see anything that address my particular code problem. I have a
Is there anything I can do with code in MATLAB for digital image processing
Before anything, let me first clarify that the below thoughts are purely my personal

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.