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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:33:00+00:00 2026-05-21T12:33:00+00:00

Currently I have a button that with jQuery/AJAX searches for all customers from a

  • 0

Currently I have a button that with jQuery/AJAX searches for all customers from a SharePoint list and my web service return an XML string. I then populate a dropdown with data from the XML.

I know wanted to pass on a parameter (customer name) for a search function and I can return what I want from the SharePoint list but my AJAX call returns error (parseerror).

To get all customers (which works):

$.ajax({
    type: "GET",
    url: "SynchroniseCustomers.asmx/GetAllCustomers",
    dataType: "text/xml",

error: function (xhr, status) {
    hideLoading();
},
beforeSend: function () {
    showLoading("customers");
},
success: function (xml) {
    hideLoading();
    populatecustomerDropdownList($(xml).text());
}

});

I am not sure on how to go on about this but I tried

var customer = CustomerName;

$.ajax({
    type: "GET",
    data: { CustomerName: JSON.stringify(customer) },
    url: "SynchroniseCustomers.asmx/GetCustomerByName",
    dataType: "json",

error: function (xhr, status) {
    hideLoading();
    alert(xhr + " " + status);
},
beforeSend: function () {
    showLoading("Customers");
},
success: function (xml) {
    hideLoading();
    populateCustomerDropdownList($(xml).text());
}
});

Can someone please point me in the right direction on how to perform this?

Thanks in advance.

  • 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-21T12:33:01+00:00Added an answer on May 21, 2026 at 12:33 pm

    Your specificing your return data type as JSON, it should be XML:

    dataType: "xml"
    

    Also this looks wrong:

    populatecustomerDropdownList($(xml).text());
    

    When you do $(xml) you access your structure just like HTML, so for example if the structure is:

    <?xml version="1.0" encoding="utf-8" ?>
    <RecentTutorials>
      <Tutorial author="The Reddest">
        <Title>Silverlight and the Netflix API</Title>
        <Categories>
          <Category>Tutorials</Category>
          <Category>Silverlight 2.0</Category>
          <Category>Silverlight</Category>
          <Category>C#</Category>
          <Category>XAML</Category>
        </Categories>
        <Date>1/13/2009</Date>
      </Tutorial>
    

    jQuery:

      success: function(xml) {
         $(xml).find("Tutorial").each(function()
         {
            $("#output").append($(this).attr("author") + "<br />");
         });
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some jQuery ajax help. I currently have a main content div that
I currently have a simple form that when you click the save button will
I am currently working on rails3 application that uses jQuery. I have a javascript
I have a form that uses jQuery Validate. You click the Submit button, form
Possible Duplicate: Stop all active ajax requests in jQuery I want to have a
I have a button with remote=>true that calls a popup (a jquery popup, not
I currently have my code set to disable the submit button when the field
Currently, I have some basic code to play a simple tone whenever a button
I currently have an MS Access application that connects to a PostgreSQL database via
I have a web-app that is a sort of calendar application and there are

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.