Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make XMLHttpRequest work over HTTPS on google chrome?
    primarykey
    data
    text
    <p>I researched a lot about this but couldn't find the magic. Actually I want to populate a list of city pin code no. using JQuery autocomplete UI. It's a https page. It's working in firefox but not in Google Chrome. Can anyone help me to resolve this issue. Thans in Advancce.</p> <p>Following is my code:</p> <pre><code>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(''); } } }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload