<?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/"
	>

<channel>
	<title>databasically // Kansas City Small Business IT &#38;&#38; Ruby on Rails Programming &#187; Ajax</title>
	<atom:link href="http://databasically.com/category/blog/programming/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://databasically.com</link>
	<description>Kansas City Small Business IT</description>
	<lastBuildDate>Tue, 20 Jul 2010 21:35:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Updating textarea with Ajax: unterminated string literal</title>
		<link>http://databasically.com/2009/03/18/updating-textarea-with-ajax-unterminated-string-literal/</link>
		<comments>http://databasically.com/2009/03/18/updating-textarea-with-ajax-unterminated-string-literal/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 19:04:01 +0000</pubDate>
		<dc:creator>Wes</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.databasically.com/?p=98</guid>
		<description><![CDATA[If you try to update a textarea with newlines in it via Ajax, you may get an &#8220;Unterminated string literal&#8221; error.  The update coming back may look like this:
$('textarea_to_update').value='line one
line two
line three';
This will fail because the javascript will interpret the newline as the end of the command.
So, replace those newlines with the newline character [...]]]></description>
			<content:encoded><![CDATA[<p>If you try to update a textarea with newlines in it via Ajax, you may get an &#8220;Unterminated string literal&#8221; error.  The update coming back may look like this:</p>
<pre name="code" class="ruby">$('textarea_to_update').value='line one
line two
line three';</pre>
<p>This will fail because the javascript will interpret the newline as the end of the command.</p>
<p>So, replace those newlines with the newline character and the textarea will get updated correctly:</p>
<pre name="code" class="ruby">textarea_value.gsub!(/\n/, '\n')</pre>
]]></content:encoded>
			<wfw:commentRss>http://databasically.com/2009/03/18/updating-textarea-with-ajax-unterminated-string-literal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
