* fix occasional review display issues
This commit is contained in:
parent
0341ba3608
commit
e4fdcb1884
|
@ -192,18 +192,20 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$.ajax({
|
$(document).ready(function () {
|
||||||
url: 'reviews.json',
|
$.ajax({
|
||||||
dataType: 'json',
|
url: 'reviews.json',
|
||||||
success: function(data) {
|
dataType: 'json',
|
||||||
var review = data[Math.floor(Math.random() * data.length)]
|
success: function(data) {
|
||||||
if (review.user.length > 0 && review.date.length > 0 && review.text.length > 0) {
|
var review = data[Math.floor(Math.random() * data.length)]
|
||||||
$('#review .user').text(review.user)
|
if (review.user.length > 0 && review.date.length > 0 && review.text.length > 0) {
|
||||||
$('#review .date').text(review.date)
|
$('#review .user').text(review.user)
|
||||||
$('#review .text').text(review.text)
|
$('#review .date').text(review.date)
|
||||||
$('#review').show()
|
$('#review .text').text(review.text)
|
||||||
|
$('#review').show()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<p class="head">Posted by <span class="user"></span> on <span class="date"></span></p>
|
<p class="head">Posted by <span class="user"></span> on <span class="date"></span></p>
|
||||||
|
|
Loading…
Reference in New Issue