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

The Archive Base Latest Questions

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

Possible Duplicate: Consuming a Web service using Javascript Please note that I’m still getting

  • 0

Possible Duplicate:
Consuming a Web service using Javascript

Please note that I’m still getting used to JavaScript. Basically I need to write an HTML file that uses Javascript to call a couple of web service methods (from the same server as the HTML file) without using Ajax or probably much of anything else that we’d have to install on there separately. We already have the web service up and running fine, as well as some JS. This needs to work for IE, FF, and Chrome, including for computers that are a couple of years “behind the times”. What is a really simple way to do this? Again, I’m still kind of getting my feet wet with JavaScript, so I’m having a hard time following and using some of the examples I’ve seen. Thanks!

EDIT: Here’s an example of the kind of thing I’ve been trying:

<html>
<head>
   <title>Hello World</title>
   <script language="JavaScript">
      var iCallID;
      function InitializeService(){
     alert("spam");
     try {
            service.useService(<WSDL address>, 
                  "HelloWorldService");
     } catch (e) {
        alert(e.message);
     }
     alert("spam");
         service.HelloWorldService.callService("HelloWorld");
     alert("spam");
      }
      function ShowResult(){
     alert("spam");
         alert(event.result.value);
     alert("spam");
      }
</script>

I get “spam”, then “Object doesn’t support this property or method”, then nothing.

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

    Ok, AJAX has been around since donkey’s years, really. But since you’re not familiar with JS, here’s a little copy-paste function you could use:

    function ajax(url,method,data)
    {
        var xhr;//ajax object
        data = data || {};//default ajax request
        method = method || 'POST';
        url = url || 'default/url/ajax';
        try
        {//normal browsers
            ret = new XMLHttpRequest();
        }
        catch (error)
        {//older IE browsers, including dead IE6
            try
            {
                ret= new ActiveXObject('Msxml2.XMLHTTP');
            }
            catch(error)
            {
                try
                {
                    ret= new ActiveXObject('Microsoft.XMLHTTP');
                }
                catch(error)
                {
                    throw new Error('no Ajax support?');
                }
            }
        }
        if (typeof ret !== 'object')
        {//if fails (almost impossible)
            throw new Error('No Ajax, FFS');
        }
        ret.open(method, url, true);//open ajax connection
        ret.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
        ret.setRequestHeader('Content-type', 'application/x-www-form-urlencode');
        ret.onreadystatechange = function()
        {
            if (this.readyState === 4 && this.status === 200)
            {
                var response = this.responseText;
                //code you want to see executed when the call was successful
            }
        };
        return ret.send(data);
    }
    

    Usage:

    ajax('your/ajax/url','POST','id=12');
    

    This will send an ajax request back to the server, with a POST parameter id, value 12… play around with that. A few things that can be useful: JSON, and -though I’m not a big fan- jQuery, it has a ready built-in $.ajax method, just pass an object literal and you’re good to go.

    Feel free to edit this function as you please

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

Sidebar

Related Questions

Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: How do JavaScript closures work? I still battle with the concept of
Possible Duplicate: How can WCF consuming data from database phpmyadmin? I want to ask
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Possible Duplicate: When to Use Double or Single Quotes in JavaScript I'm confusing what
Possible Duplicate: C# localization , really confusing me Could someone please share their localization
Possible Duplicate: Conflicting boolean values of an empty JavaScript array What is the rationale
Possible Duplicate: What is the fastest XML parser in PHP? I still need to
Possible Duplicate: Difference of create Index by using include column or not using Edit:
Possible Duplicate: PHP get all arguments as array? Within a javascript function arguments always

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.