Jump to content

New Twitter API issue...


Chris74

Recommended Posts

Hi, I'm having a problem integrating the new twitter timeline widget in the footer of my WHMCS site.

 

This works fine in a plain HTML page, but not inside WHMCS. The widget code consists of a hyperlink tag and a javascript tag. The javascript is as follows...

 

<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>

 

In WHMCS, viewing the javascript console - this comes up as a syntax error - it is as if WHMCS is stripping out some of the javascript...

 

SyntaxError: syntax error
[break On This Error] 	

!function(d,s,id)}(document,"script","twitter-wjs");

 

In a normal HTML page, inspecting the surrounding div with firebug shows that the hyperlink tag has correctly changed into an iframe with the twitter feed in. The script tag contains the full javascript above. With WHMCS it shows the hyperlink in its raw state and the script tag only contains the following...

 

!function(d,s,id)}(document,"script","twitter-wjs");

 

I've looked around for a solution but so far I've drawn a blank. Any suggestions would be gratefully received.

Link to comment
Share on other sites

This has been a long standing issue with smarty templates. I really cant see why they need literal tags for script blocks, they already have tags that could easily be used to identify the code correctly. <script></script>

 

Id just makes no sense to me at all why they insist on another tag being used. We dont have to use it for any other html tag so why these i will never understand.

 

One thing that really sits foul with me is this sort of thing.

 

{literal}

<script>

jQuery(function(){

jQuery('#dosomething').attr('{/literal}{$oh_damnit_i_need_this}{literal}');

});

</script>

{/literal}

 

There is just no need for such dismal hackery, smarty needs to get smart!

Edited by CDJ Hosting
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated