This is a migrated thread and some comments may be shown as answers.

Two twitter timeline widgets in two different views - One loads the other doesn't

1 Answer 21 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gal
Top achievements
Rank 1
Gal asked on 05 Aug 2014, 05:52 PM
Greetings,

I have the following views setup:

<!-- 3.3 Twitter View -->
<div data-role="view" id="DannyTwitter" data-init="twitterInit()" data-layout="twitterLayout">
    <a class="twitter-timeline" href="https://twitter.com/USER" data-widget-id="ID1" data-chrome="noheader nofooter">Tweets by @</a>      
</div>
 
<!-- 3.4 Twitter View -->
<div data-role="view" id="LindseyTwitter" data-layout="twitterLayout" data-init="twitterInit()">
    <a class="twitter-timeline" href="https://twitter.com/USER" data-widget-id="ID2" data-chrome="noheader nofooter">Tweets by @</a>
</div>

And twitterInit() is just the standard timeline widget JS wrapped in a function:
<script>function twitterInit(){ !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");}</script>

This works only if I switch between the two views BEFORE the timeline loads (when you can only see the "Tweets by @"). If I stay on one view and wait for the timeline then go to the next one, it's empty. It essentially creates the two iFrames, but the view that isn't displayed gets a blank iFrame while the one displayed has a timeline full iframe... Any ideas why this happens? I can attach images of the elements if you need it.

1 Answer, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 08 Aug 2014, 01:35 PM
Hi Gal,

In order to benefit from AppBuilder support service we kindly ask you to consider renewing your license.
In the meantime we suggest using additional forums like StackOverflow and their community knowledge to find a solution for your case.
Thanks.

Regards,
Zdravko
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
General Discussion
Asked by
Gal
Top achievements
Rank 1
Answers by
Zdravko
Telerik team
Share this question
or