{!! Form::select('name', $emails, null, ['id'=>'name','class' => 'form-control']) !!}
{!! Form::textarea('content', null, ['id'=>'content','class' => 'form-control']) !!}
<script type="text/javascript">
$( "#name" ).change(function(){
var name = $(this).val();
$.ajax({
url: "{!! route('admin.email.getcontent') !!}",
type: "GET",
data: { name: name },
success : function(result){
$( "#content" ).val(result);
}
});
});
</script>因此,当我更改combobox值时,textarea值将根据我在combobox中选择的文件进行更改
javascript运行得很好,但我在文本区域看到的是带有HTML标记的纯文件内容,如
<html>
<body>
aaaa this is body
</body>
</html>如何使我的文本区成为一个HTML编辑器,当我选择组合框时,只有HTML渲染的结果显示如
aaaa this is body该怎么做呢?
发布于 2015-12-22 11:52:42
你的意思是你希望它是html而不是字符串?试试htmlspecialchars_decode()
https://stackoverflow.com/questions/34408083
复制相似问题