Comments (8)
Hi @tonyouyang,
sorry I don't really understand what you mean. Can you elaborate?
Thanks!
from wysihtml5.
Hi @tiff ,
I intended to revise the content in textarea. I've got it done. Sorry to bother!
from wysihtml5.
Can I ask - what was the solution? I think I'm trying the same thing to no avail.
I want to update the entire value of the text area with a completely new value. I'm using jQuery:
$("#content").val("this is <b>new</b> content");
Where "content" is my text area. I see the text area getting the new value, but the wysihtml5 doesn't update. Any modification to the wysihtml5 side then reverts my text area.
How does one request the wysihtml5 area to refresh?
from wysihtml5.
Hi @pkimbrel . I didn't "refresh". I just set textarea's value before initializing of wysihtml5.
from wysihtml5.
Hey @pkimbrel,
try wysihtml5.Editor.prototype.setValue
.
Example:
myEditor = new wysihtml5.Editor("...");
// ...
myEditor.setValue("<p>foobar</p>", true);
from wysihtml5.
That did the trick! Thanks guys!
Another quick question. I see from the source code that the 2nd parameter of setValue() (the boolean) is "parse". What is the implication of setting that to false? I tried it with "false" and it still worked. I will say, though that I had valid markup. Is that a safety in case I try to set invalid markup?
from wysihtml5.
If the second parameter is true wysihtml5 will run the html through the parser to make sure the html matches the given parser rules before displaying it.
For example if you disabled iframe tags in your parser rules then this html:
<p>foobar</p><iframe src="http://www.google.de"></iframe>
will be converted to
<p>foobar</p>
It's recommended to always set it to true since the html will anyway be parsed at some time (eg. before the form gets submitted)
from wysihtml5.
@tiff Awesome! Thank you very much. Love this plug-in!
from wysihtml5.
Related Issues (20)
- Chrome - Cursor Jumping HOT 2
- Many textarea HOT 2
- Custom text colors
- Words merged in editor
- Focus on many textareas
- Show images with local url in attribute src HOT 1
- alex
- Removes Closing Tag For img, br and input elements
- Function for updating iframe CSS
- Multiple Submit Functions are called in Angularjs2
- Scroll bar does not automatically scroll to bottom after paste
- Firefox compatibility problems
- Font-Size not Overriding HOT 1
- How to add multiple rich text editors?
- Set default text align to right
- set different heading styles in same line
- Android native and Chrome browser error in console: Uncaught TypeError: Cannot read property 'contentDocument' of undefined
- How to add attribute "id"?
- I cannot post long text! HOT 1
- Cannot remove custom color. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wysihtml5.