Skip to content
This repository has been archived by the owner on Sep 2, 2019. It is now read-only.

$("#post_body").val("string")赋值操作后前台无法显示,再调用val()有“string”返回 #14

Open
unclemcz opened this issue Aug 2, 2016 · 2 comments

Comments

@unclemcz
Copy link

unclemcz commented Aug 2, 2016

前台编辑器无法显示val()赋值的内容,同时试过innerHtml等等,都无法显示,不知何故?

@wangGuangXu
Copy link

讲富文本数据保存后,再次查看的时候,进行一下3种方式绑定:均不起作用。
document.getElementById('content').value=jsonData.content;
$("#content").val(jsonData.content);
$("content").html(jsonData.content);

jsonData.content为从服务端获取的富文本内容。

@wangGuangXu
Copy link

问题自己解决了:
解决办法:
image

先赋值后实例化,如果Textarea 标签上有placeholder 属性需要隐藏

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants