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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:27:56+00:00 2026-05-15T11:27:56+00:00

I use to work with the animation on jquery but never ajax, so it’s

  • 0

I use to work with the animation on jquery but never ajax, so it’s my first experience with $.ajax() function of jquery:

I am trying to make my web application only using jquert library, I checked over the web for a good tutorial to make asp.net and jquery work, and I found an walkthrought, in this article they send a int to an WebMethod and it work for me, but in my case I want to send String and/or objects.

I know the issue is int the datatype and/or contentType.
here is my code sample.

<script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
<script language="javascript">
$(document).ready(function() {
  $("#name").change(function() {
    var myname = this.value;
    var options = {
      type: "POST",
      url: "dollarajax.aspx/hello",
      data: "{nom:" + myname + "}",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function(response) {
        if (response.d != "") {
          alert(response.d);
          $("#name").focus();
        }
      }
    };
    $.ajax(options);
  });
});
</script>

[WebMethod]
public static string hello(String nom)
{        
    return ("hello my friend: " + nom);
}

so any idea or any document where i can figure the trick to make it work?
thanks

  • 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-15T11:27:56+00:00Added an answer on May 15, 2026 at 11:27 am

    Try to change the data like this:

    data: '{"nom":"'+ myname +'"}',
    

    instead of:

    data: "{nom:" + myname + "}", 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use this code to create a simple jquery carousel animation: $(document).ready(function() { var
I'm trying to create a never-ending looping animation using ExtJs, but am hitting the
I have a reference application that I use to work through DDD issues, and
I have trouble to make a good use of jQuery fadeIn() or fadeOut() for
I'm trying to use Uploadify for the first time. I have no issues with
Are there any jQuery 1.3 animation-transitions that work in both Firefox 3 and IE7?
I am trying to use this: http://abeautifulsite.net/blog/2011/01/jquery-selectbox-plugin/ to add a transition by default to
I'm trying to accomplish some animation with sets in Raphael, but even though an
I have been really puzzled because I was trying to work out some jQuery
I am trying to use pipes for my animate commands in a jQuery script.

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.