如何在网站

时间:2017-08-22 09:07:58

标签: javascript jquery html css wixcode

所以我试图将最新的企业家资料从Medium @ femalefounderssg嵌入到Wix上制作的网站上,我试图在这里使用JSON和jQuery代码:https://codepen.io/jasonm4130/pen/vZYbQx

var tagIndex = item.description.indexOf('<img'); // Find where the img tag starts
var srcIndex = item.description.substring(tagIndex).indexOf('src=') + tagIndex; // Find where the src attribute starts
var srcStart = srcIndex + 5; // Find where the actual image URL starts; 5 for the length of 'src="'
var srcEnd = item.description.substring(srcStart).indexOf('"') + srcStart; // Find where the URL ends
var src = item.description.substring(srcStart, srcEnd); // Extract just the URL
output += '<div class="blog-element"><img class="img-responsive" src="' + src + '" width="360px" height="240px"></div></header>';

我面临的问题是,由于代码呈现了它看到的第一个内容,它总是呈现徽标(如下图所示),我希望与帖子一起显示的企业家个人资料照片通常包含在第二次

output of above code in my implementation

有人可以建议如何修改现有代码或其他可能的实现吗?非常感谢!

0 个答案:

没有答案