Copied to clipboard

Flag this post as spam?

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


  • Bob 38 posts 160 karma points
    Feb 10, 2017 @ 14:01
    Bob
    0

    How to run JavaScript on masterpage

    Using umbraco 6, I would like to create a user control which would create some JavaScript so it's placed on the masterpage header section.

    How could I achieve this? So far I have a string builder which holds my custom JavaScript but what's the best way to get it to be placed within the header section of the masterpage I choose without affecting the current code that's already in the header section?

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Feb 10, 2017 @ 17:12
    Alex Skrypnyk
    0

    Hi Bob

    If you want do not touch header code it's better to put js at the bottom of the "head" tag.

    For rendering js you can use macro or just usual usercontrol.

    Thanks,

    Alex

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Feb 15, 2017 @ 10:42
    Alex Skrypnyk
    0

    Hi Bob

    Very interesting how did you solve the issue, can you share, please?

    /Alex

Please Sign in or register to post replies

Write your reply to:

Draft