Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Brandon Brigham
Brandon Brigham
3,716 Points

Review feed is acting weird

Hello,

A site I'm working on:

http://valleyoakca.com/tenants/

If you notice on the right sidebar there's a 'Testimonials' section. When scrolling through the reviews the text doubles-up (not sure how else to explain it) and the text gets jumbled up.

Any ideas on how to fix?

Thanks!

2 Answers

You have twice in your code this part

<iframe src="http://www.reputation.com/embed_reviews/valley-oak-property-management-modesto?h=500&amp;w=300&amp;c=&amp;f=&amp;l=&amp;p=20" style="height: 500px; width: 300px; overflow: hidden; position: absolute; border: none;"></iframe>
<iframe src="http://www.reputation.com/embed_reviews/valley-oak-property-management-modesto?h=500&amp;w=300&amp;c=&amp;f=&amp;l=&amp;p=20" style="height: 500px; width: 300px; overflow: hidden; position: absolute; border: none;"></iframe>

Just remove one of them and everything will be ok.

Brandon Brigham
Brandon Brigham
3,716 Points

Hey Daniel thanks for the reply - the code I've used in the widget area of WordPress is shown below - for some reason its showing up twice when inspecting the element I suppose. Any ideas?

<html>
<head>

<script type="text/JavaScript" src="http://www.reputation.com/js/repbiz_public/reviews.widget.js" type="text/JavaScript" charset="utf-8"></script>

</head>

<body>
<div id="reputation-reviews" style="width:300px;height:500px"></div>

</body>

<script type="text/JavaScript">

var widgetParameters = {
"locationName" : "valley-oak-property-management-modesto",  //required
"containerName" : "reputation-reviews", //required
"reviewsPageSize" : 20,                 //optional - default 20
"hideTestimonialPageLink" : true,       //optional – default false
"whiteLabel" : true,                //optional – default false
"backgroundColor" : "",                 //optional e.g. 333333
"fontFamily" : "",                      //optional
"textColor" : ""                        //optional e.g. 000000
}

window.reputation.reviewWidgetController.init(widgetParameters);

</script>

</html>

Honestly, it's not looking as Wordpress plugin problem. If you disable js on your page it will not produce Testimonial area. So that is looking like you initialize JS-plugin twice on page.

window.reputation.reviewWidgetController.init(widgetParameters);

Twice on page. In page and after body closing tag.

If you type the same code in console it will create 3rd overlaying container. It's not so easy to find "why" without access to the Theme and so on.