jquery get data value

http://jsfiddle.net/Kzd57/6/

"[[{"MYID":22636,"MyComment":"testing text box","BID":11069},{"MYID":22636,"MyComment":"next comment","BID":11070}]]"

Open in new window


Not knowing why I cannot retrieve these values. not sure what is different than when I done before.
LVL 9
Seven priceFull StackAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
you don't run the function
you don't have a valid JSON objet to use $.each
you have an if(obj.BlotterId) and nowhere BlotterId

Test page : http://jsfiddle.net/Qq656/

function fnSuccess(response) {
	var toAppend = "";
	alert("test");

	var obj = jQuery.parseJSON(response);
	$.each(obj, function(i, item) {
		//if(typeof obj.BlotterID != 'undefined') {
			//$('.stack').show();
      		toAppend += '<div style=""><label>Comments #11 : </label><textarea id=' + item.BID + '  name='+  obj.BID + '"  cols="40" rows="6">' + item.myComment + '</textarea></div>'; 
		//}
 	});
	$('.stack').append(toAppend);
}

fnSuccess('[{"MYID":22636,"myComment":"testing text box","BID":11069},{"MYID":22636,"myComment":"next comment","BID":11070}]');

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Seven priceFull StackAuthor Commented:
I see but this is the way the data is returned and I get undefined error.

http://jsfiddle.net/Qq656/12/
0
Seven priceFull StackAuthor Commented:
var data = $.parseJSON(response.d.toString()); 
$.each(data, function(i, item) {
alert(item);
$('.stack').show();

Open in new window


I do not freakin understand, this all should work but I just cannot get the data to show within the div but I can see it in the popup and in the DOM.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Seven priceFull StackAuthor Commented:
Response
{"d":"[[{\"myID\":22636,\"Comment\":\"testing text box\",\"BID\":11069},{\"ID\":22636,\"Comment\":\"next comment\",\"BID\":11070}]]"}

Json
d	"[[{"myID":22636,"Comment":"testing text box","BID":11069},{"ID":22636,"Comment":"next comment","BID":11070}]]"

Open in new window


what is going on.
0
leakim971PluritechnicianCommented:
http://jsfiddle.net/Qq656/16/

function fnSuccess(response) {
	var toAppend = "";
	alert("test");

	var obj = jQuery.parseJSON(response.d)[0];
	$.each(obj, function(i, item) {
		//if(typeof obj.BlotterID != 'undefined') {
			//$('.stack').show();
      		toAppend += '<div style=""><label>Comments #11 : </label><textarea id=' + item.BID + '  name='+  obj.BID + '"  cols="40" rows="6">' + item.Comment + '</textarea></div>'; 
		//}
 	});
	$('.stack').append(toAppend);
}

fnSuccess({"d":"[[{\"myID\":22636,\"Comment\":\"testing text box\",\"BID\":11069},{\"ID\":22636,\"Comment\":\"next comment\",\"BID\":11070}]]"}
)

Open in new window

0
Seven priceFull StackAuthor Commented:
I just learned it was not the front end, it is the way I selected in link. wow something new. Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.