Hello Twitter Community,
currently I’m facing a problem which I’m trying to solve for almost 8 hours now but I’m still making no progresses. For a lottery app users are able to tweet a post and receive points afterwards. Everything is working fine… except in Internet Explorer.
The Tweet button is not showing up instead only a textlink is available and when I click the link it says I cannot load this page in an iframe.
What could cause the problem?
The code below is placed above the tag.
<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.id=id;
js.src="//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs);
return window.twttr || (t = { _e: [], ready: function(f){ t._e.push(f) } });
}(document, "script", "twitter-wjs"));
twttr.ready(function (twttr) {
// Now bind our custom intent events
twttr.events.bind('follow', twitterEvent_follow);
twttr.events.bind('tweet', twitterEvent_tweet);
//twttr.events.bind('click', twitterEvent_click);
//twttr.events.bind('retweet', twitterEvent_retweet);
//twttr.events.bind('favorite', twitterEvent_favorite);
});
//follow - EventHandler
function twitterEvent_follow(intent_event) {
if (intent_event) {
var newPoints = <?php echo $action_follow_points_toget;?>;
doneAction(newPoints);
};
function doneAction(newPoints)
{
var fbid ='<?php echo $fb_id ?>';
var action ='<?php echo $action_follow_points_action ?>';
var points = parseInt('<?php echo $action_follow_points;?>');
if(points <= 0)
{
points = newPoints;
setPoints(fbid, points, action);
window.location.reload();
}
}
}
//tweet - EventHandler
function twitterEvent_tweet(intent_event) {
if (intent_event) {
var newPoints = <?php echo $action_tweet_points_toget;?>;
doneAction(newPoints);
};
function doneAction(newPoints)
{
var fbid ='<?php echo $fb_id ?>';
var action ='<?php echo $action_tweet_points_action ?>';
var points = parseInt('<?php echo $action_tweet_points;?>');
var points_limit = parseInt('<?php echo $action_tweet_points_toget_limit;?>');
if(points < points_limit)
{
if(points > 0){
points += newPoints;
updatePoints(fbid, points, action);
}else{
points += newPoints;
setPoints(fbid, points, action);
}
}
}
}
</script>
These are my two button codes:
<a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php echo constant('TWEET_LINK');?>" data-text="<?php echo constant('TWEET_TEXT');?>" data-count="none" data-hashtags="<?php echo constant('TWEET_HASHTAG');?>">Tweet</a>
<a href="https://twitter.com/<?php echo constant('TWITTER_FOLLOW');?>" class="twitter-follow-button" data-show-count="false" data-lang="de" data-show-screen-name="false">@<?php echo constant('TWITTER_FOLLOW');?> folgen</a>