|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
DeanPickersgill Smarty n00b
Joined: 07 Feb 2016 Posts: 4
|
Posted: Thu Mar 10, 2016 8:37 am Post subject: Using the Twitter Widget javascript ... |
|
|
... 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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Mar 10, 2016 5:07 pm Post subject: |
|
|
Sounds like you have safehtml filter applied by default. |
|
Back to top |
|
|
|
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
|