MyBB Community Forums
Enable Javascript in a MyCode? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Enable Javascript in a MyCode? (/thread-156262.html)



Enable Javascript in a MyCode? - mybbworld - 2014-07-19

How do I enable javascript in a MyCode?
I am trying to add Chitika ads in a post through MyCode

<script type="text/javascript">
  ( function() {
    if (window.CHITIKA === undefined) { window.CHITIKA = { 'units' : [] }; };
    var unit = {"calltype":"async[2]","publisher":"ygrkqce","width":468,"height":60,"sid":"Chitika Default"};
    var placement_id = window.CHITIKA.units.length;
    window.CHITIKA.units.push(unit);
    document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
}());
</script>
<script type="text/javascript" src="//cdn.chitika.net/getads.js" async></script>

Best Regards,


RE: Enable Javascript in a MyCode? - VoIP - 2014-07-20

My guess it would be the same way you would do html.


RE: Enable Javascript in a MyCode? - mybbworld - 2014-07-21

(2014-07-20, 12:45 PM)Ace700 Wrote: My guess it would be the same way you would do html.

thanks for your response but when i enter above code in MyCode replacement it shows nothing in the forum.


RE: Enable Javascript in a MyCode? - Vashnik - 2014-07-21

You will likely need to do core modifications where MyBB filters script tags. One such file would be /inc/class_parser.php and search for <s(cript, however doing so can open security issues for your board. An alternative (and I think there are plugins that do this, if not in MyBB, then other software) is to implement them through the templates.

Ultimately, the question is more or less, what is the goal you wish to achieve for adding the ads? (besides generating revenue for your site/forum). How often do you want the ads to appear, or are you attempting to add it to your (or a bot's, maybe?) signature on your board? Those type of questions.


RE: Enable Javascript in a MyCode? - mybbworld - 2014-07-21

Thanks All for response, I think <script> tag is not working in MyCode thats why I am unable to add chitika and jw player 6 through a mycode, anyways; i am no longer interested to implement both of them in my forum.
Best Regards,