Mudsaf Posted July 20, 2013 Share Posted July 20, 2013 Somehow i can't get my JSON, JavaScript & jQuery function working. item = selectData.selectList[i].selectLevel.length; //Example Returns 2console.log(selectData.selectList[i].selectLevel.substr(item,1)); //Doesn't work gives empty string item = 2; //Returns 2console.log(selectData.selectList[i].selectLevel.substr(item,1)); //Works gives received string I've tried parseInt() function on item and everything but just cant seem to get it working. Link to comment Share on other sites More sharing options...
Ingolme Posted July 20, 2013 Share Posted July 20, 2013 Are you sure that selectData.selectList[i].selectLevel is actually referencing an element? Link to comment Share on other sites More sharing options...
Mudsaf Posted July 21, 2013 Author Share Posted July 21, 2013 (edited) Well yes its referencing to element and returning values. Edited July 21, 2013 by Mudsaf Link to comment Share on other sites More sharing options...
Mudsaf Posted July 21, 2013 Author Share Posted July 21, 2013 Ah my bad, had wrong calculations Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now