TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
r p
NA
343
0
How to create an array in jquery using Class Objects return
Nov 20 2013 11:07 AM
I am trying to create an array using the Class Objects I receive from a web service call.
I want to create an arrray called data.
My code looks like this; but it is not working.
I don't know where I am going wrong.
var data = [];
$(document).ready(function () {
$.ajax({
type: "POST",
url: "MyWebService.asmx/GetMyClassObjects",
data: "{ val1: 'val1', val2: 'val2' }",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
var myData = data.d;
for (var i = 0; i < myData.length; i++)
{
data.push
(
{ id: myData[i].id, fname: myData[i].Fname, lname: myData[i].Lname}
);
}
}
});
});
Thanks for your help.
Reply
Answers (
2
)
update panel not working on web server
How to save multiple files in database by multifileupload c