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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:58:07+00:00 2026-06-18T01:58:07+00:00

I am trying to make jquery autocomplete to be work on https (secured pages)

  • 0

I am trying to make jquery autocomplete to be work on https (secured pages) pages but its not showing any dropdown.
I searched on this issue and found that its security issue.

can any one tell me how to turn on this autocomplete dropdown on https pages.

here is my code to jquery autocomplete :

function zipAutoCompletet(prefix) {
  jQuery("#" + prefix + "_zip").autocomplete({
    source: function (request, response) {
      jQuery.ajax({
        url: "http://ws.geonames.org/postalCodeSearchJSON",
        dataType: "jsonp",
        data: {
          style: "full",
          maxRows: 12,
          postalcode_startsWith: request.term
        },
        success: function (data) {
          response(jQuery.map(data.postalCodes, function (item) {
            return {
              label: item.placeName + (item.adminCode1 ? ", " + item.adminCode1 : "") + ", " + item.postalCode + ", " + item.countryCode,
              value: item.postalCode
            }
          }));
          jQuery('.ui-autocomplete').css('width', '188px');
        }
      });
    },
    minLength: 2,
    select: function (event, ui) {
      var myString = new String(ui.item.label);
      var address = myString.split(',')
          jQuery('#' + prefix + '_city').val(address[0]);
      jQuery('#' + prefix + '_city').addClass('activated');
      jQuery('#' + prefix + '_city').trigger('change');
      jQuery('#' + prefix + '_city').parents('.row').removeClass('error-row')
        jQuery('#' + prefix + '_city').parents('.row').addClass('ok-row')
          var countryCode = address[3] ? address[3] : address[2]
              countryCode = jQuery.trim(countryCode);
      var countryName = jQuery('#' + prefix + '_country option[value="' + jQuery.trim(countryCode) + '"]').text()
          jQuery('#countryContainer .jqTransformSelectWrapper span').html(countryName)
            jQuery('#countryContainer .jqTransformSelectWrapper').addClass('selected-jqtranform');
      jQuery('#' + prefix + '_country').parents('.row').addClass('ok-row')
        jQuery('#' + prefix + '_country').parents('.row').removeClass('error-row')
          jQuery('#' + prefix + '_country').val(jQuery.trim(countryCode))
            var stateCode = address[2] ? address[1] : '';
      stateCode = jQuery.trim(stateCode)
        if (countryCode == 'US') {
          var base = base_url;
          base = base.replace("https", "http");
          jQuery.ajax({
            url: base + "/getStateName",
            dataType: "jsonp",
            data: {
              stateCode: stateCode
            },
            success: function (data) {
              stateName = data
                jQuery('#jc_state').val(stateName);
              jQuery('#jc_state').addClass('activated');
              jQuery('#jc_state').parents('.row').removeClass('error-row')
                jQuery('#jc_state').parents('.row').addClass('ok-row')
                  jQuery('#jc_state').trigger('change');
              formValidate();
            }
          });
        } else {
          stateName = stateCode
            jQuery('#jc_state').val(stateName);
          jQuery('#jc_state').addClass('activated');
          jQuery('#jc_state').parents('.row').removeClass('error-row')
            jQuery('#jc_state').parents('.row').addClass('ok-row')
              jQuery('#jc_state').trigger('change');
          formValidate();
        }
      jQuery('#' + prefix + '_zip').parents('.row').addClass('ok-row')
        jQuery('#' + prefix + '_zip').parents('.row').removeClass('error-row');
    },
    open: function () {
      jQuery(this).removeClass("ui-corner-all").addClass("ui-corner-top");
    },
    close: function () {
      jQuery(this).removeClass("ui-corner-top").addClass("ui-corner-all");
    },
    change: function (event, ui) {
      if (ui.item === null) {
        jQuery("#" + prefix + "_zip").parents('.row').removeClass('ok-row');
        jQuery("#" + prefix + "_zip").parents('.row').addClass('error-row');
        $("#" + prefix + "_zip").val('');
      }
    }
  });
}

I am using above code for zipcode field.This code works fine on non-https pages it works fine but when I tried it with https pages it doesnt shows.

any solutions are welcome.

  • 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-18T01:58:08+00:00Added an answer on June 18, 2026 at 1:58 am

    As I looked into the service provider they are supporting jsonp and the following sample worked

    $("input").autocomplete({
        source: function (request, response) {
            $.getJSON("http://ws.geonames.org/postalCodeSearchJSON?callback=?", 
              { 'postalcode_startsWith': request.term, maxRows: 12, style: "full" }, 
              function(data) {
                  if(data.postalCodes){
                      var x = $.map(data.postalCodes, function(v, i){
                          console.log(v)
                          return {
                              label: v.placeName + ' - ' + v.postalCode, 
                              v: v.postalCode
                          }
                      });
                      response(x);
                  }
              }
            );        
        }
    });
    

    Demo: Fiddle

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

Sidebar

Related Questions

I'm trying to make simpleModal jquery script to work, but cannot figure out what
I'm trying to make jQuery Autocomplete, Yahoo Finance and Zend Framework work together. What
I'm trying to make my jQuery nav work, but it won't act like I
I am trying to make this jquery carousel work with different widths. Right now
I am trying to make custom autocomplete input (I know about jQuery UI autocomplete,
i was trying out the jquery ui autocomplete and its pretty easy to implment
I am trying to use jQuery's fancy autocomplete function but I have a problem
I have been trying to make jquery datepicker plugin work on a content page
I have been trying to make JQuery DateTimePicker add-on to work with asp.net textbox
I'm trying to make this jquery plugin => http://leandrovieira.com/projects/jquery/lightbox/ work with multiple galleries on

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.