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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:11:15+00:00 2026-05-18T21:11:15+00:00

I am using JQuery ajax for authenticating username and password, however due to security

  • 0

I am using JQuery ajax for authenticating username and password, however due to security reason I need to call HTTPS request.

Below is my JQuery Code: where I need to implement the HTTPS call.

 //Submitting the form
$("#loginDetails > form").submit(function()
{  
    //Hiding the Login button
    $("#loginButton").hide();

    //Showing the ajax loading image
    $("#ajaxloading").show();

    // 'this' refers to the current submitted form  
    var str = $(this).serialize();   
    // -- Start AJAX Call --

    $.ajax({  
        type: "POST",
        url: "Login.aspx",  // Send the login info to this page
        data: str,  
        success: function(result)
        {  

            $("#loginDetails").ajaxComplete(function(event, request, settings)
            {  

             // Show 'Submit' Button
            $('#loginButton').show();

            // Hide Gif Spinning Rotator
            $('#ajaxloading').hide();  

            var resLength = result.trim().length;

            if(resLength!=0)
            {
                var arr = result.split(",");
                var fname = arr[0];
                var lname = arr[1];
                var activeCardNo = arr[2];
                var multipleTier = arr[3];
                var activeStatus = arr[4];
                var access = arr[5];

                 if(access!='' && access!='undefined') // LOGIN OK?
                 { 
                     $('.validateTips').hide();
                    var login_response = '<div id="logged_in">' +
                     '<div style="width: 350px; float: left; margin-left: 80px;">' + 
                     '<div style="width: 40px; float: left;">' +
                     '<img style="margin: 22px 0px 10px 0px;" align="absmiddle" src="system/images/ajax-loader.gif">' +
                     '</div>' +
                     '<div style="margin: 24px 0px 0px 10px; float: right; width: 300px;">'+ 
                     "You are successfully logged in! <br /> Please wait while you're redirected...</div></div>";  

                    $('#loginButton').hide();
                    $('#closeBtn').hide();
                    $('#divMember').text(fname +' '+ lname);
                    $('#spnSkywardsNo').text(activeCardNo);
                    $('#spnTierStatus').text(multipleTier);
                    $("#ui-dialog-title-skywardsLogin").text(getDataFromResourceFile('pleaseWait'));

                    $('#divSuccessLogin').html(login_response);
                    $('#divSuccessLogin').show();
                    $('#loginDetails').hide();
                    //$(this).html(login_response); // Refers to 'status'

                    // After 3 seconds redirect the 
                    setTimeout(closeDialog, 3000); 

                 }  
              }
            else// ERROR?
             {  
                 var login_response = getDataFromResourceFile('InvalidUsername');
                 $('.validateTips').html(login_response);
             }

     });  

     }  

    });  

    // -- End AJAX Call --

    return false; 
});  

The above code works perfect, but due to security issues, I need to change my call call to HTTPS, so my ajax call will not be “Login.aspx” it will be “https://login.aspx&#8221;

Please suggest how to achieve this, so that my security is maintained and there will not be any security conflict.

  • 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-18T21:11:15+00:00Added an answer on May 18, 2026 at 9:11 pm

    This will happen by default if the page is https://, this has to be the case…you can’t make an AJAX request from an http:// page to an https:// destination, and vice-versa. When you try this, it’s seen as a different protocol, and in violating of the same origin policy, so you’ll be prevented from seeing the response.

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

Sidebar

Related Questions

How would you access the cache from a jQuery ajax call? I'm using jquery
I make an AJAX request like so using JQuery: $.ajax({ type: GET, url: getvideo.php,
I am doing Ajax call using jQuery and my URL is like http://localhost;3327/DummyAps/Demo.aspx In
Heh, I'm using jQuery AJAX Call to pull data from a self hosted webservice
I'm using jquery ajax to post updates back to my server. I'm concerned about
I'm having difficulty parsing some JSON data returned from my server using jQuery.ajax() To
When using jQuery 's ajax method to submit form data, what is the best
I'm using jQuery's ajax methods to interact with the Twitter REST API . Their
I am using jQuery and Ajax, and my Ajax.php file returns the following field
I am using jQuery and Ajax. My MainFile has the following code: <html> <head>

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.