Script tags not embedded

  • Unknown's avatar

    I am on the Creator plan, and trying to embed a custom JS widget on my site with the Custom HTML block. The widget consists of one div and one script tag that loads a js script. However, this is not working on my site, it only displays the url of the script and does not load the script. How can I get the JS to run on my site?

    WP.com: Yes
    Jetpack: No
    Correct account: Yes

    The blog I need help with is: (visible only to moderators and staff)

  • Unknown's avatar

    To add some more detail, WordPress is automatically changing my script tags to a tags.

  • Unknown's avatar

    Make sure you’ve put in the script tag correctly, with the right URL for the script. Sometimes, the place where you’re trying to add the HTML block doesn’t let JavaScript run, which is another thing to look out for.
    If the script is meant to load on its own, you need to make sure that it’s set up correctly in the tag. Also, the place where your script is hosted needs to let your site use it—this is called the CORS policy.
    The ‘div’ you’re using should be right where you need it, and its name should match what the script is looking for. Sometimes, widgets need you to start them up with some extra JavaScript after the main script loads.

  • Unknown's avatar

    Thank you for contacting us!

    The problem arises from the fact that although you have the Creator plan, your site has not yet been transferred to the plugin-enabled hosting platform, which would grant you access to code only permitted on those plans.

    Since you first posted, it appears that your site has been relocated to https://swwidgettest.wpcomstaging.com/, so your code should now be functioning correctly. Please inform us if you encounter any further issues.

  • The topic ‘Script tags not embedded’ is closed to new replies.