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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:48:15+00:00 2026-05-31T20:48:15+00:00

I have this HTML <a href=/noJavascript id=rejoinGroups>Rejoin</a> <a href=/noJavascript class=removeGroup id=Testing>Remove</a> and I am

  • 0

I have this HTML

<a href="/noJavascript" id="rejoinGroups">Rejoin</a>
<a href="/noJavascript" class="removeGroup" id="Testing">Remove</a>

and I am binding the links to a function using unobstrusive javascript like so:

$(function SetUp()
    {
    var el = document.getElementById('rejoinGroups');
    el.onclick = rejoinGroups;
    var removeElements = document.getElementsByClassName('removeGroup');
    for (var i = 0; i < removeElements.length; i++) {
        removeElements[i].onclick = function() {
            removeGroup(this.id);
        }
    }
  });

There may be many ‘Remove’ link generated hence why I am binding it differently, (but currently I have only one), and am passing the id as the function parameter.

These are the functions I am biding to. I have deliberately made them identical for testing as the first one (with the groupName parameter) doesn’t work, but the second one does and I don’t understand why. Once this issue is fixed I’ll actually use the groupName parameter. The second returns a 200 code and the first immediately gives an ‘Error0’ message, then goes to the /noJavascript page. I can only assume it’s something to do with the parameter, but it seems to be set correctly, so I’m not sure what it is. What am I missing?

function removeGroup(groupName){    
    $.ajax({
            url: '/tasks/aTask',
            type: 'POST',
            data: {userId:38},
            success: function(data, textStatus, jqXHR) 
            {         
               alert(jqXHR.status);                      
            },
            error: function(jqXHR, textStatus, errorThrown)
            {
               alert("Error" + jqXHR.status);
            }
        });
        return false;        
}

function rejoinGroups(){
   $.ajax({
            url: '/tasks/aTask',
            type: 'POST',
            data: {userId:38},
            success: function(data, textStatus, jqXHR) 
            {         
               alert(jqXHR.status);                      
            },
            error: function(jqXHR, textStatus, errorThrown)
            {
               alert("Error" + jqXHR.status);
            }
        });
        return false;
}    

this is what I get in the chrome dev window for the second function:

Request URL:http://localhost:8888/tasks/aTask
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-GB,en-US;q=0.8,en;q=0.6
Connection:keep-alive
Content-Length:9
Content-Type:application/x-www-form-urlencoded
Cookie:dev_appserver_login=test@example.com:true:18580476422013912411; JSESSIONID=10yktze1j72fa
Host:localhost:8888
Origin:http://localhost:8888
Referer:http://localhost:8888/users/38
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11
X-Requested-With:XMLHttpRequest
Form Dataview URL encoded
userId:38
Response Headersview source
Content-Length:0
Server:Jetty(6.1.x)

and this is what I get for the first (failing) one:

Request URL:http://localhost:8888/tasks/aTask
Request Headersview source
Accept:*/*
Content-Type:application/x-www-form-urlencoded
Origin:http://localhost:8888
Referer:http://localhost:8888/users/38
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11
X-Requested-With:XMLHttpRequest
Form Dataview URL encoded
userId:38
  • 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-31T20:48:16+00:00Added an answer on May 31, 2026 at 8:48 pm

    I’m not very sure, but I think it might be because your anonymous function is not returning the result of the function. Try changing:

    removeGroup(this.id);
    

    to

    return removeGroup(this.id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this in my HTML <a class=deleteLink href=system/id>link</a> Then using jQuery, I run
I have this content inside a html page : mypage.html <a href=http://site1 target=_blank class=hrefClass
I have this html code that I need to parse <a class=sushi-restaurant href=/greatSushi>Best Sushi
I currently have this in my document $(document).ready(function(){ $([href$='.html']).addClass('html'); $([href$='.pdf']).addClass('pdf'); }); which styles any
I have this html. <a class=link href=www.website.com?id=233253>test1</a> <a class=link href=www.website.com?id=456456>test2</a> How can I hide
i have this html: <span class=price> $61.00 <span class=detailFreeShipping>With Free Shipping</span> </span> How to
I have this html: <div class=foo parent> <div class=child></div> </div> with some css: .foo{
I have this HTML structure (excerpt): <td> <select id=test1 class=pub_chooser> <option value=99>All Publications</option> <option
I have this jQuery get request: $.get($(this).attr(href), { searchExpression: schroders }, function (result) {
I have one page design with scrolling eased by jquery using this code: function

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.