<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>zweistein's blog &#187; JavaScript</title>
	<atom:link href="http://zweistein.wordpress.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://zweistein.wordpress.com</link>
	<description>Periodical rantings about science, technology, art &#38; other stuff life wouldn't be fun without.</description>
	<lastBuildDate>Sat, 08 Jul 2006 20:23:35 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>hr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='zweistein.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ba0e634d666e415e40f699fa84e84d12?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>zweistein's blog &#187; JavaScript</title>
		<link>http://zweistein.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://zweistein.wordpress.com/osd.xml" title="zweistein&#8217;s blog" />
		<item>
		<title>Modifying a TinyMCE-powered Textarea</title>
		<link>http://zweistein.wordpress.com/2006/04/18/modifying-a-tinymce-powered-textarea/</link>
		<comments>http://zweistein.wordpress.com/2006/04/18/modifying-a-tinymce-powered-textarea/#comments</comments>
		<pubDate>Tue, 18 Apr 2006 12:54:46 +0000</pubDate>
		<dc:creator>Nikola Plejic</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">https://zweistein.wordpress.com/2006/04/18/modifying-a-tinymce-powered-textarea/</guid>
		<description><![CDATA[TinyMCE is a great WYSIWYG JavaScript control which can easily convert any textbox on your site to a powerful WYSIWYG editor. The problem with TinyMCE is that it limits you &#8211; it filters out the HTML code, trying to keep the code it generates clean and standards-compliant.
Although there&#39;s really nothing wrong with that (it&#39;s nice [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zweistein.wordpress.com&blog=172474&post=16&subd=zweistein&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://tinymce.moxiecode.com/">TinyMCE</a> is a great WYSIWYG JavaScript control which can easily convert any textbox on your site to a powerful WYSIWYG editor. The problem with TinyMCE is that it limits you &#8211; it filters out the HTML code, trying to keep the code it generates clean and standards-compliant.</p>
<p>Although there&#39;s really nothing wrong with that (it&#39;s nice actually), it causes trouble when you try to edit the textbox (using the DOM) from anything outside of TinyMCE &#8211; your own JavaScript, for instance &#8211; and refuses to insert any HTML into the textbox.</p>
<p>The workaround? Disable TinyMCE, make and apply your modifications and enable it again:</p>
<p><code>tinyMCE.execCommand(&quot;mceRemoveControl&quot;, false, elemid);<br />
tinyMCEmode = false;<br />
// the code for manipulating the text box<br />
tinyMCE.execCommand(&quot;mceAddControl&quot;, false, elemid);<br />
tinyMCEmode = true;</code></p>
<p>Note that you should replace the &quot;elemid&quot; variable with the ID of the HTML element you&#39;re modifying.</p>
<p>This also works from a popup window (assuming it has been opened by the page which contains the HTML element you want to modify):&nbsp;</p>
<p><code>window.opener.</code><code>tinyMCE.execCommand(&quot;mceRemoveControl&quot;, false, elemid);<br />
</code><code>window.opener.</code><code>tinyMCEmode = false;<br />
// the code for manipulating the text box<br />
</code><code>window.opener.</code><code>tinyMCE.execCommand(&quot;mceAddControl&quot;, false, elemid);<br />
</code><code>window.opener.</code><code>tinyMCEmode = true;</code></p>
<p>The same note for &quot;elemid&quot; applies here, too.&nbsp;</p>
<p>There you go&#8230; And it wasn&#39;t that hard, either :).&nbsp;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/zweistein.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/zweistein.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/zweistein.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/zweistein.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/zweistein.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/zweistein.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/zweistein.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/zweistein.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/zweistein.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/zweistein.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/zweistein.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/zweistein.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=zweistein.wordpress.com&blog=172474&post=16&subd=zweistein&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://zweistein.wordpress.com/2006/04/18/modifying-a-tinymce-powered-textarea/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d262dc4caee2e6765a1a5af74b4069be?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">zweistein</media:title>
		</media:content>
	</item>
	</channel>
</rss>