Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Giancarlo Massaro 1 post 21 karma points
    Oct 01, 2013 @ 16:47
    Giancarlo Massaro
    0

    Cannot get javascript to display on site

    Hello,

    I'm trying to get a snippet of javascript code to work on my site and have gone through multiple posts on this forum trying different things, but can't get anything to work. The javascript code that I'm adding is supposed to display a widget on the frontend. 

    Here is the code:

    <script type="text/javascript">
    var cnt_id = "66363925-1638";
    </script><br />
    <script type="text/javascript" src="https://www.viralsweep.com/external/widget.js"></script>

    Here's what I've tried:

    1) Pasting the code directly into the editor using the HTML button. Once I add in the code and click save, I get the "Cannot have ']]>' inside an XML CDATA block" error.

    Oddly enough though, if I add the code in, then go to 'Edit in Canvas' the actual widget that I'm supposed to see on the frontend does appear for me in the page.

    2) Add javacscript to a macro, then in the editor select the macro and add it in. 
    When doing this, the macro gets added to the editor, and once I click save and check the page, the widget is not appearing.

    Any other ideas? Just a heads up, the editor is set to allow custom markup.

    Thanks!

  • Streety 358 posts 568 karma points
    Oct 03, 2013 @ 11:13
    Streety
    0

    The easy way to check is simple enough.

    Load you site in Firefox, add the addin Firebug.

    Inspect the html to see if the js is present on the page. For instance I had an issue yesterday where a bit of JS wasn't firing and it was a path to the js file issue.

    Firebug saw the js inclusion line but had no js running.

    That should do it.

Please Sign in or register to post replies

Write your reply to:

Draft