Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    May 16, 2012 @ 04:16
    Tom
    0

    force umbraco razor to render as text

    Hi i have a cshtml file..

    I know to use @: for a line of text.. just wondering how you render that for a block of text..

     

    it keeps interpreting my js function as something else..

    var cleanResults =  data.results[0].replace(/<?\/body[^>]*>/g,'');
                    cleanResults = cleanResults.replace(/[\r|\n]+/g,'');
                    cleanResults = cleanResults.replace(/<--[\S\s]*?-->/g,'');
                    cleanResults = cleanResults.replace(/<noscript[^>]*>[\S\s]*?<\/noscript>/g,'');
                    cleanResults = cleanResults.replace(/<script[^>]*>[\S\s]*?<\/script>/g,'');
                    cleanResults = cleanResults.replace(/<script.*\/>/,'');
  • David F. Hill 122 posts 242 karma points
    Jun 05, 2012 @ 21:52
    David F. Hill
    0

    Hi Tom,

    If I understand your question correctly, you can put your js inside text tags like this:

    <text>
    var cleanResults =  data.results[0].replace(/<?\/body[^>]*>/g,'');
    cleanResults = cleanResults.replace(/[\r|\n]+/g,'');
    cleanResults = cleanResults.replace(/<--[\S\s]*?-->/g,'');
    </text>

    Hope that helps.

    David

Please Sign in or register to post replies

Write your reply to:

Draft