Click here to Skip to main content
13,043,865 members (48,233 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hi all,
I am created one web services my web services name "HostingService.asmx". in my web services having no of methods. am added one html page in same project, now am calling json web services using ajax,jquery. its working fine. my script code is
   <script language="javascript" type="text/javascript">
 $("#btnok").live("click", function () {
             var username = $("#name").val();
             var password = $("#password").val();
             var clientid = $("#clientid").val();
                 type: 'POST',
                 url: 'HostingService.asmx/SETusers',
                 data: "{username:" + JSON.stringify(username) + ",password:" + JSON.stringify(password) + ",clientid:" + JSON.stringify(clientid) + "}",
                 contentType: 'application/json; charset=utf-8',
                 dataType: 'json',
                 success: function (data, status) {

this script code working fine. after deploying my web services and assign to one port/IP address in server. like "". this is my web services url. now am creating one html page with out project using notepad. and adding the same code just modified the url in ajax method. my url like
url: "" and
"" am tried in different ways. but my code is not working in html page. my alert box shows the empty message.
using scripts are
<script src="Scripts/jquery-ui-1.8.1.custom.min.js" type="text/javascript"></script>
  <script src="" type="text/javascript"></script>
   <script type="text/javascript" src=""></script>
  <script type="text/javascript" src=""></script>

please tel me, how to find the error, how to solve my problem.

thanking you.
Posted 8-Jan-13 1:13am
Updated 8-Jan-13 4:26am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This is probably the Cross domain issue. for the cross domain you have to use the JSONP instead of JSON. Please see below for more details.[^]

Here is the nice article for your reference[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100