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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:13:20+00:00 2026-06-10T15:13:20+00:00

I am using Ajax do do cross domain calls using JSON, and the script

  • 0

I am using Ajax do do cross domain calls using JSON, and the script works fine in FF but in ie the script will not populate the select menu with the results, in ie it will display errors so i know the script is definitely working and making cross domain calls, can anyone tell me what i am doing wrong?

function xss_ajax(url) {

    var script = document.createElement('script');
    script.setAttribute('type', 'text/javascript');
    script.setAttribute('src', url);
    script.setAttribute('id', 'script_id');

    script_id = document.getElementById('script_id');
    if (script_id) {
        document.getElementsByTagName('head')[0].removeChild(script_id);
    }


    document.getElementsByTagName('head')[0].appendChild(script);

    document.getElementById("addrlist").innerHTML = "";
    document.getElementById("errlog").innerHTML = "";
}

function callback(data) {

    if (typeof data['error'] != "undefined") {
        if (window.on_error) {
            on_error();
        }

        if (document.getElementById("errlog")) {
            document.getElementById("errlog").innerHTML = "<br>" + data['error'] + "<br>";
        } else {
            alert(data['error']);
        }

    } else {



        var val = data['address1'] + ", " + data['address2'] + ", " + data['address3'] + ", " + data['address4'] + ", " + data['postcode'];

        document.getElementById("addrlist").innerHTML += "<option value='" + val + "'>" + val + "</option>";

    }
}

function searchpost() {

    var license = '98798797';
    var url = "http://mydomin.co.uk/myfile.php?postcode=" + escape(document.getElementById("field1").value) + '&license=' + escape(license);

    xss_ajax(url);

}
  • 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-10T15:13:21+00:00Added an answer on June 10, 2026 at 3:13 pm

    I think it is the way that you add the options to the select. Create a new option element and add to the select element instead of replacing all the HTML content:

    var opt = document.createElement('OPTION');
    opt.text = val;
    opt.value = val;
    document.getElementById("addrlist").options.add(opt);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this Ajax script below to make cross domain Ajax calls which
I'm making a cross-domain AJAX request using jQuery but my callback function is not
We are using the Dynamic Script Tag with JsonP mechanism to achieve cross-domain Ajax
I am doing a cross domain request using $.ajax . It works on Firefox
I am making cross-domain Ajax calls using the latest version of jQuery 1.7.1. with
For what I understand cross-domain AJAX calls are not possible for security reasons .
I am attempting to write a user script that makes a cross domain AJAX
I'm using a cross-domain Ajax request to an external API. Every so often it
I'm attempting to make a cross domain script call to get some JSON data
Because of strange cross domain AJAX problems, causing AJAX requests to fail when not

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.