0

I have a simple javascript demo file [demo.js], stored in the [sitecollection]/[site]/SiteAssets/Scripts directory:

<html>
    <body>
        <script type="text/javascript">
            var today = new Date();
            document.write("<p> Today is: " + today.toString() + "</p>");
        </script>
    </body>
</html>

If I put the code into a SEWP, it delivers the defined output. However if I put the link ~/SitesAssets/Scripts/demo.js into the jslink of a task list, nothing is happening. What am I doing wrong? Thank you!

1 Answer 1

1

Don't make an html file, just a javascript file without the html, body or script tags.

alert('jslink in da house!');
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.