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

The Archive Base Latest Questions

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

I have an object decorated with [DataContract] attribute and my WCF service is returning

  • 0

I have an object decorated with [DataContract] attribute and my WCF service is returning this as JSON like this:

{"GetCommentsByPostResult":[{"CommentCreated":"\/Date(1305736030505+0100)\/","CommentText":"Comment 1"},{"CommentCreated":"\/Date(1305736030505+0100)\/","CommentText":"Comment 2"},{"CommentCreated":"\/Date(1305736030505+0100)\/","CommentText":"Comment 2"}]});

Ive attempted to iterate through the CommentCreated with this jQuery code:

$(data).each(function () 
{
     alert(this.CommentCreated);
});

But all I get is an alert box with ‘undefined in’ so I changed it to:

 $(data).each(function () {

         $(this.GetCommentsByPostResult).each(function () {

                      alert(this.GetCommentsByPostResult);
         });

 });

but that still doesnt work. What I want to do is iterate the CommentCreated and throw them to an alert box….

  • 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-22T11:50:16+00:00Added an answer on May 22, 2026 at 11:50 am

    I’m not sure, but I don’t think this would be the current element when calling each. Also, why are you wrapping the data variable with the jQuery function? jQuery collections are for DOM elements.

    $.each(data.GetCommentsByPostResult, function (e) {
        alert(e.CommentCreated);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so I have two objects that look like this in my WCF service.
I have a source object that looks like this: private class SourceObject { public
I have a ASP.NET web service decorated with System.Web.Script.Services.ScriptService() so it can return json
I'm working with a simple object in WCF decorated with the DataContract and DataMember
I have this object: stdClass Object ( [daily_inventoryID] => 1 [inventory_timestamp] => 2012-06-08 14:35:42
I have decorated my controller with an Authorize attribute, as so: [Authorize(Roles=ExecAdmin)] If I
I have created my own attribute to decorate my object. [AttributeUsage(AttributeTargets.All)] public class MyCustomAttribute
I'm using Ninject 2.2.1.4 and Ninject.Extensions.Wcf 2.2.0.4. My service is decorated with the following
I have created a WCF service which returns IEnumerable<CyberResourceProvisioningAction> . The CyberResourceProvisioningAction type has
I have a service decorated as a singleton. It is hosted in IIS on

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.