Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-01-2012, 05:22 PM   PM User | #1
FowlerS47
New to the CF scene

 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
FowlerS47 is an unknown quantity at this point
$.post $.each , This returned undefined

I am trying to post URL results with collected data (the this.itemOne ....) by iterating using $.post , $.each to gather the data, i need to capture this data append it together (the URL + data) and post some result. I am fairly new at this so any help would be appreciated. Thanks!

oh, also based on the code below my .this object returns undefined. I need to correct that.




var Alpha = function() {
this.itemOne = 1;
this.itemTwo = 2;

this.doSomething = function(withThis) {
$.post("/post/url", { data: withThis },
function(result) {
this.itemOne = result.resultOne;
this.itemTwo = result.resultTwo;
});
};
this.doSomethingElse = function(withThese) {
for (var i = 0; i < Things.length; i++) {
$.each(Things[i].subItems, function(subItem) {
};
};
$.post("/post/url2", { data: withThese.postData},this.postResponse);
};
};

Alpha.prototype.postResponse = function(data) {
this.doSomething(data);
};
FowlerS47 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:57 AM.


Advertisement
Log in to turn off these ads.