0

I've implemented Facebook's like-button, the Twitter button and Pinterests button on a WordPress blog with 20 posts per page. The problem is that with the buttons the page get's really slow to load, for like 5-10 seconds i can't scroll. If i have a look at Chrome's console i can see that lot's of JavaScript errors are thrown, and all of them looks like this

Unsafe JavaScript attempt to access frame with URL https://www.mysite.com/blog/?cat=1 from frame with URL https://s-static.ak.facebook.com/connect/xd_arbiter.php?version=11#channel=f5468fe14&origin=https%3A%2F%2Fwww.mysite.com&channel_path=%2Fblog%2F%3Fcat%3D1%26fb_xd_fragment%23xd_sig%3Df17b68bb04%26. Domains, protocols and ports must match.

Now i assume that the unresponsive page (can't scroll while loading) will be solved if i get rid of all these errors. Problem is i have no idea what is causing them.

The example above is just for Facebook, but the Pinterest and Twitter buttons also throws lot's of errors.

Since the page also have Facebook login i've tried commenting out all of that code but with the same result.

I am using Facebooks API found on this URL

https://connect.facebook.net/sv_SE/all.js
Anton Gildebrand
  • 3,641
  • 12
  • 50
  • 86
  • I have successfully solved similar issues by putting the js for social loading just before the final body tag, then the full page loads before the buttons – jtheman Oct 21 '12 at 12:40
  • I don't that should be the issue since the parsing of the fbxml is called within the document.ready function, but i'll definitvely try it out. – Anton Gildebrand Oct 21 '12 at 13:04
  • If you search for your errors you will find s lot: http://stackoverflow.com/questions/4324108/unsafe-javascript-attempt-to-access-frame-with-url for example. Since We dont have your code its hard to debug further... – jtheman Oct 21 '12 at 13:08
  • For starters, could it be that these errors are causing the site to render slow? What do you think? – Anton Gildebrand Oct 22 '12 at 07:31
  • I suggest you check load times for the web page in a tool like Firebug's Net tab or similar, hence you will see what process interrupts what and load times for each part of your page. My point is that js errors very well could be the cause of slow rendering. But not in all situations. – jtheman Oct 22 '12 at 07:36
  • That js error you're getting is normal. I have a facebook app (that performs fine) which racks up dozens of these errors per second. Check out this question: http://stackoverflow.com/questions/3010170/unsafe-javascript-attempt-to-access-frame-with-url-error-being-continuously – Zach Lysobey Oct 22 '12 at 15:32

0 Answers0