【发布时间】:2016-05-14 14:44:55
【问题描述】:
http://darrenbachan.com/js/main.js
我不知道如何解决这个问题。我根本不知道 javascript 来调试或理解其他文章/线程。要让错误出现,请单击不是前两个项目之一的项目,您会在控制台中看到它。
我有项目:
'zeckoshop' : {
'title' : 'zeckoShop',
'description' : 'An all-in-one ecommerce platform designed to seamlessly integrate with your business operations.',
'link' : 'http://darrenbachan.com/playground/zeckoshop/index.html',
'images': [
'/images/zeckoshop/zeckoshop-1.jpg'
],
'tags': [
'Web Design',
'Web Development'
],
'process-description' : 'An all-in-one ecommerce platform designed to seamlessly integrate with your business operations.',
'process-wireframes': [
'/images/zeckoshop/zeckoshop-1.jpg'
]
},
'diamond-hand-car-wash' : {
'title' : 'Diamond Hand Car Wash',
'description' : 'Feeling luxurious is only one car wash away.',
'link' : 'http://darrenbachan.com/playground/diamond-hand-car-wash/index.html',
'images': [
'/images/diamond-hand-car-wash/diamond-1.jpg'
],
'tags': [
'Web Design',
'Web Development'
],
'process-description' : 'test',
'process-wireframes': [
'/images/zeckoshop/zeckoshop-1.jpg'
]
},
'edutravel-for-credit' : {
'title' : 'EduTravel For Credit',
'description' : 'Innovative travel for credit. Completely engage in your learning through exploration and discovery.',
'link' : '',
'images': [
'/images/edutravel-for-credit/edu-1.jpg',
'/images/edutravel-for-credit/edu-2.jpg',
'/images/edutravel-for-credit/edu-3.jpg',
'/images/edutravel-for-credit/edu-4.jpg'
],
'tags': [
'Web Design',
'Newsletter'
]
},
因为 'process-description' 和 'process-wireframes' 不在项目 'edutravel-for-credit' 中,所以会产生此错误。
拉取这个内容的代码是:
if($('#process-description').length) {
$('#process-description').html(projectData['process-description']).show();
} else {
$('#process-work').hide();
}
$('#process-wireframes').empty('');
$.each(projectData['process-wireframes'], function(item) {
$('#process-wireframes').append('<div class="project-gallery"><img src='+projectData['process-wireframes'][item]+' /></div>')
});
它将内容吐出到这个 html 中:
<div id="process-work">
<h2 id="process-title">Process Work</h2>
<p id="process-description"></p>
<div id="process-wireframes"></div>
</div>
我真的不知道如何调试这个问题,并且可以使用我能获得的任何帮助。无论是在这里还是Skype会话或其他什么。我需要拼命显示这个内容。
【问题讨论】:
-
你已经问过同一个问题 4 次了。请停止。如果您编辑您的问题,它会向上移动,但请不要再次发布。该帖子已被标记为关闭。
-
@RachelGallen 我之前编辑过我的问题。其他问题之一是关于 if/else 语句的具体问题,这导致该问题在 cmets 中仅进行了一点讨论。我承认我确实欺骗了这个问题,那是因为即使在编辑问题之后我也没有得到回应,但我这样做了,我实际上看到人们试图帮助我。很抱歉违反了网站的规则。
标签: javascript jquery html