Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Using the Twitter Widget javascript ...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
DeanPickersgill
Smarty n00b


Joined: 07 Feb 2016
Posts: 4

PostPosted: Thu Mar 10, 2016 8:37 am    Post subject: Using the Twitter Widget javascript ... Reply with quote

... is driving me crazy! I'm sure there's a 'right' way to do this, but for the life of me I can't find it.

I'm using the standard code from Twitter to get a users timeline and forming it so's there's no problem with curly braces. The code works fine when called from my HTML page.

However, when I {include} the HTML page which includes that code, the widget doesn't display. The only way I can get it to display is to put the <script> tag in the smarty template that {includes} the HTML. That works fine, the widget displays, but as there is no closing </script> tag, then all my HTML formatting on the included page fails.

I've tried {literal}{/literal} and individual delimiters, but it's not a curty-brace problem, simply seems to be where <script> is before {include} on the template ...

Can anyone point out a way around this please?

CODE FROM TWITTER
==============
<script>
!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>
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Mar 10, 2016 5:07 pm    Post subject: Reply with quote

Sounds like you have safehtml filter applied by default.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP