Client.js not loading and page keeps refreshing



I have been facing an issue with the Tweet button (and follow button) script on my web app. I get the following error on page load and then the page keeps reloading infinitely.

[12:58:30.482] Error: not loaded @

My app uses iframe to embed my app into websites.
I have tried to remove https, and/or have only http. but nothing helps.

Script im using:

<script type="text/javascript">
 window.twttr = (function (d,s,id) {
  var t, js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return; js=d.createElement(s);;
  js.src=""; fjs.parentNode.insertBefore(js, fjs);
  return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));

Any help would be highly appreciated. 

Thank You
Prerak Mehta


Could you tell me the browser you are using?
And if possible do you have any page I could access reproducing that problem?



I am using Chrome and Firefox (both latest versions).
Sure. So on this page you can sign in on the bottom bar and then click on your display picture or name for a popup to open up. You will see that the popup (an iframe) will keep reloading.

Thanks so much
Prerak Mehta


The problem is not directly in Twitter’s code, but in your, in the receiver12 event listener, you always change the src of the iframe:
jQuery(’#open_it #rwd_container’).children(‘iframe’).attr(‘src’,newSrc);
And that’s what reloads the content of the iframe.

The message that event handler receives each time the iframe is loaded is a message from our code (to get the URL of the page).
You should ignore messages that are ours. At the first line of your receiver12 just add something like:
if ( &&‘twttr’) != -1) return;


:smiley: thats great. it worked :slight_smile:

Thanks so much!!