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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:09:17+00:00 2026-05-11T08:09:17+00:00

I’m trying to decide whether to use a custom ASP.Net Ajax Extender or jQuery

  • 0

I’m trying to decide whether to use a custom ASP.Net Ajax Extender or jQuery to perform a simple web service call. The web service method accepts a customer ID and returns the customer name. I’m leaning towards jQuery because of it’s simplicity. The only problem is that due to my company’s IE7 Group Policy settings, the first time jQuery invokes a web service it prompts the user with the following message:

A script is accessing some software (an ActiveX control) on this page which has been marked safe for scripting. Do you want to allow this?

The Extender does not cause this message to be displayed. I’m assuming the ASP.Net Ajax library has some javascript voodoo that suppresses it. So my questions is, How do I suppress this message using javascript?

Here’s my aspx markup:

<h1>     Finder Test</h1> <div>     <h2>         Extender</h2>     Customer ID:     <asp:TextBox ID='txtCustomerId' runat='server' MaxLength='9' Width='4em' />     <belCommon:FinderExtender ID='extCustomerId' runat='server' TargetControlID='txtCustomerId'         ResultLabelID='lblResult' ServicePath='~/Customer.asmx' ServiceMethod='Name' />     <asp:Label ID='lblResult' runat='server' /> </div> <div>     <h2>         jQuery</h2>     Customer ID:     <input id='txtCustomerId2' type='text' maxlength='9' style='width: 4em;' value='0000' />     <span id='txtCustomerName2'></span>      <script type='text/javascript'>         $(document).ready(function()         {             $('#txtCustomerId2').change(             function()             {                 updateCustomerDescription(this.value, 'txtCustomerName2');             }).change();         });          function updateCustomerDescription(id, descriptionControlId)         {             // if we don't have a value, then don't bother calling the web service             if (id == null || id.length == 0)             {                 $('#' + descriptionControlId).text('');                 return;             }              jsonAjax('customer.asmx/Name', '{'id':'' + id + ''}', true,                 function(result)                 {                     var name = result.d == null ? '' : result.d;                     $('#' + descriptionControlId).text(name);                 }, null);         }          function jsonAjax(url, data, async, onSuccess, onFailed)         {             $.ajax({                 async: async,                 type: 'POST',                 url: url,                 data: data,                 contentType: 'application/json; charset=utf-8',                 dataType: 'json',                 success: onSuccess,                 error: onFailed             });         }     </script> </div> 

[Update]

I’m assuming that the ActiveX control referenced in the message is XMLHttpRequest. I’m also assuming that the internals of jQuery and ASP.Net Ajax both use it for IE7.

[Update]

The difference appears to be in how ASP.Net Ajax and jQuery construct an instance of XMLHttpRequest.

ASP.Net Ajax (thanks @Jesse Dearing):

 window.XMLHttpRequest = function window$XMLHttpRequest() {  var progIDs = [ 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP' ];  for (var i = 0, l = progIDs.length; i < l; i++) {   try {     return new ActiveXObject(progIDs[i]);   }   catch (ex) { }   }      return null;   } } 

jQuery 1.3.2:

// Create the request object; Microsoft failed to properly // implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available // This function can be overriden by calling jQuery.ajaxSetup xhr:function(){     return window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest(); } 
  • 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. 2026-05-11T08:09:17+00:00Added an answer on May 11, 2026 at 8:09 am

    I solved this by overriding jQuery’s xhr function as so:

    function overrideJqueryXhr() {     $.ajaxSetup({         xhr: function()         {             if (window.XMLHttpRequest)             {                 return new XMLHttpRequest();             }             else             {                 var progIDs = ['Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'];                  for (var i = 0; i < progIDs.length; i++)                 {                     try                     {                         var xmlHttp = new ActiveXObject(progIDs[i]);                         return xmlHttp;                     }                     catch (ex)                     {                     }                 }                  return null;             }         }     }); } 

    This function tells jQuery to create an instance of the XMLHttpRequest class for non-IE browsers, and then creates an ActiveX object the MS Ajax way for IE. It tries the latest version first, Msxml2.XMLHTTP.3.0, then Msxml2.XMLHTTP and finally Microsoft.XMLHTTP.

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

Sidebar

Ask A Question

Stats

  • Questions 156k
  • Answers 156k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The first one will use the value of $name as… May 12, 2026 at 10:50 am
  • Editorial Team
    Editorial Team added an answer Short answer is no. Compiler knows how to parse this… May 12, 2026 at 10:50 am
  • Editorial Team
    Editorial Team added an answer Take a look to: http://www.web-development-blog.com/archives/send-e-mail-messages-via-smtp-with-phpmailer-and-gmail/ May 12, 2026 at 10:50 am

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.