$.each(json.data,function(i,fb){
//some code here...
if (msg.length > 150) {
msg = msg.substr(0,200)+"...";
}
//more code here...
});
I have an issue here. If msg is not defined I got an error and I got nothing displayed on the browser.
Possible Solution: create a default message for the cases where msg is not defined.
Try:
if (msg = 'undefined') {
msg = 'some default message';
} else if (msg.length > 150) {
msg = msg.substr(0,200)+"...";
}
Issue: The above try didn't work because I get for each item, the same default message, instead of having the default message only for those cases were msg is no "set".
Request: Can I have your help in order to write the proper code so that, on each item, if msg is not defined show a default one, if otherwise, it's site, display it ?
If you lack some information in order to proper help me, please, let me know. I'm really on a bad position right now. :s
Thanks a lot, MEM