Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未捕获的语法错误:意外标记非法textarea呈现_Javascript_Jquery_Asp.net Mvc - Fatal编程技术网

Javascript 未捕获的语法错误:意外标记非法textarea呈现

Javascript 未捕获的语法错误:意外标记非法textarea呈现,javascript,jquery,asp.net-mvc,Javascript,Jquery,Asp.net Mvc,我试图在textarea中呈现简单的html,就好像它是内联html一样。 这就是我试过的- 简单html- <html> <head> </head> <body> <h4>Header</h4> <div style="color:green">This is the text here with the imframe template </di

我试图在textarea中呈现简单的html,就好像它是内联html一样。 这就是我试过的-

简单html-

<html>
    <head>
    </head>
    <body>
        <h4>Header</h4>
        <div style="color:green">This is the text here with the imframe template </div>
    </body>
</html>
 $('#temphtmlcode').val("@Html.Raw(Model.Template)");
 <textarea style="height: 215px; width: 500px;" id="temphtmlcode"></textarea>
这里的
Model.Template
以上述html方式来自数据库-

我的文本区-

<html>
    <head>
    </head>
    <body>
        <h4>Header</h4>
        <div style="color:green">This is the text here with the imframe template </div>
    </body>
</html>
 $('#temphtmlcode').val("@Html.Raw(Model.Template)");
 <textarea style="height: 215px; width: 500px;" id="temphtmlcode"></textarea>

此文本区域不包含html,并显示意外错误。 请帮我做这个

$('#temphtmlcode').val("@Html.Raw(Model.Template)");
试一试


视图无法识别Json。@AakankshaSingh..很抱歉,我没有得到您的信息???@Html.Raw(Json.Encode(Model.Template),此处
Json在当前上下文中不存在problem@AakankshaSingh...see在这里