0
I have that code:
if(post.link[k].type == 'post miniatura'){
var postMiniatura = post.link[k].href;
} else {
var postImage;
try {
postImage = post.media$image.url
} catch (error) {
s = post.content.$t;
a = s.indexOf("<img");
b = s.indexOf("src=\"", a);
c = s.indexOf("\"", b + 5);
d = s.substr(b + 5, c - b - 5);
if ((a != -1) && (b != -1) && (c != -1) && (d != "")) {
postImage = d
}
}
}
What I tried to do was this: Case the post.link[k].type
be "thumbnail post" it executes the code and to, ie, does not execute the rest that is after the else
. Only what happens is that even post.link[k].type
be true, it executes the code after Else as well. I wanted what this after Else to be executed only if post.link[k].type
was not equal to "miniature post". What do I do? (I’m a beginner in JS)