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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:40:00+00:00 2026-06-03T07:40:00+00:00

I have this post request code in jquery, which seems to send the request

  • 0

I have this post request code in jquery, which seems to send the request and get back results (I can see it in fiddler) but somehow in the webapp it is going to error and giving a empty alert. whats wrong?

var jqxhr =$.post("http://abhishek:9090/abc/login.action",
    { emailaddress:     e_add,
      projectid:    p_id },
      function(xml)
      {     
      /*not coming here, goes to error*/

          if($(xml).find('isSuccess').text()=="true")
          {
            sessiontoken=$(xml).find('sessiontoken').text();

            var formMainRef=document.createElement("form");
            formMainRef.action="http://abhishek:9090/abc/home.action";
            formMainRef.method="post";
            formMainRef.target="_self";
            formMainRef.id="launch";
            document.body.appendChild(formMainRef);

            var cfgemailField = document.createElement("input");
            cfgemailField.name="emailaddress";
            cfgemailField.type="hidden";
            cfgemailField.value=e_add;
            formMainRef.appendChild(cfgemailField);

            var cfgpidField = document.createElement("input");
            cfgpidField.name="projectid";
            cfgpidField.type="hidden";
            cfgpidField.value=p_id;
            formMainRef.appendChild(cfgpidField);

            var cfgstField = document.createElement("input");
            cfgstField.name="sessiontoken";
            cfgstField.type="hidden";
            cfgstField.value=sessiontoken;
            formMainRef.appendChild(cfgstField);                                

            setCookie("abcsessionid", sessiontoken , 1);
            setCookie("abcusername",e_add,1);

            formMainRef.submit();
          }
      }
)
.error(function() {
  if(jqxhr.responseText == 'INVALID_SESSION') {
    alert("Your Session has been timed out");
    window.location.replace("/abc/view/index.html"); 
  }else  {
    /*comes here, after sending request*/
    alert( jqxhr.responseText);
  }
});

login.action returns a small xml

<Response>
  <sessiontoken>4611686352224309486</sessiontoken>
  <isSuccess>true</isSuccess>
</Response>
  • 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-03T07:40:01+00:00Added an answer on June 3, 2026 at 7:40 am

    Including the domain is an issue due to the potential of cross domain requests that the browser would block. By using relative paths, you are double confirming that the script you’re posting to, resides on your local server, bypassing any potential security restrictions

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

Sidebar

Related Questions

I have my front end script which has the following jQuery code: $.get(/backend/post.php, {
I have a situation where I send jquery ajax post request but in my
i have this jquery code which works fine, but the image at the end
I have this PHP code in a loop for every post on the admin
I have this function in jQuery that gets data from a page with POST,
I have an AJAX request (using JQuery) that calls a PHP script which does
I have a page that uses jQuery's $.post() method to get some html and
I'm new to jquery and ajax - just can't seem to get this to
I have this jQuery code (function () { function load_page (pagename) { $.ajax({ url:
I've got this textBox which triggers off an ajax request using jQuery: <asp:TextBox ID=postcodeTextBox

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.