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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:39:58+00:00 2026-06-01T15:39:58+00:00

Anyone can tell me what I’m doing wrong? I am creating a simple system

  • 0

Anyone can tell me what I’m doing wrong?
I am creating a simple system to get people in and out of user groups and for that purpose I am using Dojo and Perl. (If I could have it my way it would be PHP but I am not the boss.)

At the moment I only use three files, one for Perl, one for JavaScript and one for CSS styles.

The start of the CGI script routes to different functions as follows:

if ($search = $cgi->param('psearch')) {
  dbConnect();
  jsonSearchPersons($search);
  dbDisconnect();
} elsif ($user_id = $cgi->param('person')){
  dbConnect();  
  create_form($user_id);
 dbDisconnect();
} elsif ($user_id = $cgi->param('saveuser')) {
  save_user();
} else {
  mainPage();
};
...
sub save_user {
  print $cgi->header(-type=>'text/plain',-charset=>'utf-8');
  print("success");
}

The problem I have now is when I want to save the new groups for the user though an Ajax call (a call to this URL: users.cgi?saveuser=xx). This should (in my point of view) be a POST call, so I made this and tried to append the resulting HTML/text in a <div> but it didn’t work:

dojo.xhr.post({
  url: "/cgi-bin/users.cgi?saveuser="+user_id,
  content: {
    new_groups: group_ids.toString()
  },
  load: function(html_content){
    var element = document.getElementById("test_area");
    element.innerHTML = html_content;
  },
  error: function(){
    alert("An error has occured during the save of new user groups.");
  }
});

When I do it with dojo.xhr.get(); it works fine, but when I do it with the POST it’s like it jumps over that part of the if statement and just appends the mainPage() function. Is there something basic I don’t understand between Dojo and Perl? Do I have to set up the pages so it will accept a POST call? Or what am I doing wrong?

NOTE: This is the first “system” I have made though Dojo and Perl. (I’m normally a PHP/jQuery kind of guy who makes everything UI by hand, so I’m kinda new to it.)

  • 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-01T15:39:59+00:00Added an answer on June 1, 2026 at 3:39 pm

    Try adding the saveuser-parameter to the content-object of dojo.xhrPost instead of passing it in the url.

    You’re trying to pass the saveuser-parameter as GET and the other as POST, maybe that confuses your serverside part.

    Try it like that:

    dojo.xhr.post({
      url: "/cgi-bin/users.cgi",
      content: {
       new_groups: group_ids.toString(),
       saveuser: user_id
      },
      load: function(html_content){
        var element = document.getElementById("test_area");
        element.innerHTML = html_content;
      },
      error: function(){
        alert("An error has occured during the save of new user groups.");
      }
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to hear if anyone can tell me a simple syntax that
Can anyone tell me if there are RDBMSs that allow me to create a
Anyone can tell me how to get and display the fps (frame rate) of
I am wondering if anyone can tell me where I am going wrong. I
I wonder if anyone can tell me why does QueryStatus() method get called so
Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in
Could anyone can tell me where I can find full ASP.NET MVC beta documentation?
I'm new to Oracle and I'm wondering if anyone can tell me what is
Came across this error today. Wondering if anyone can tell me what it means:
Can anyone tell me how I can display a status message like 12 seconds

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.