Copied to clipboard

Flag this post as spam?

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


  • Christian Rieß 24 posts 46 karma points
    May 04, 2012 @ 11:04
    Christian Rieß
    0

    umbraco.library.RegisterJavaScriptFile not working

    Hi there,

    I have a very nasty problem with razor when trying to dynamically register Java Script Files. I am using umbraco 4.7.1.1. My script looks as follows:

     

    @{
    umbraco.library.RegisterJavaScriptFile("jquery-latest", "/scripts/jquery-latest.js");
    <div>Registering Java Script</div>
    umbraco.library.RegisterJavaScriptFile("jquery.cycle", "/scripts/jquery.cycle.js");
    <div>Registering Java Script</div>
    }

    The output "Registering Java Script" is displayed, so the code is executed. There is also no error Message. I have a header tag with runat="server", so the error is very unlikely to be found there. As a test I wrote an XSLT script, which was able to register the script files.

    Is the function somehow broken in razor? Or am I doing something wrong?

  • Christian Rieß 24 posts 46 karma points
    May 07, 2012 @ 10:43
    Christian Rieß
    0

    Does anyone have an idea? Otherwise I would have to use an ugly workaround...

Please Sign in or register to post replies

Write your reply to:

Draft