<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: My Text Runneth Over</title>
      <link>http://ask.metafilter.com/51998/My-Text-Runneth-Over/</link>
      <description>Comments on Ask MetaFilter post My Text Runneth Over</description>
	  	  <pubDate>Wed, 29 Nov 2006 15:01:59 -0800</pubDate>
      <lastBuildDate>Wed, 29 Nov 2006 15:01:59 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: My Text Runneth Over</title>
  	<link>http://ask.metafilter.com/51998/My-Text-Runneth-Over</link>	
  	<description>I am inserting a large amount of links and text into a DIV tag using innerHTML after a page loads.  For some reason, the HTML I am inserting is overflowing to the right of the DIV and not wrapping.  I have a feeling, the browser cannot perform its normal text-wrapping because I am adding the HTML after the fact.  Is there any technique via CSS or javascript to prevent this overflow from happening?</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2008:site.51998</guid>
  	<pubDate>Wed, 29 Nov 2006 14:22:05 -0800</pubDate>
  	<dc:creator>jasondigitized</dc:creator>
	
	<category>html</category>
	
	<category>css</category>
	
	<category>javascript</category>
	
</item>
<item>
  	<title>By: cillit bang</title>
  	<link>http://ask.metafilter.com/51998/My-Text-Runneth-Over#785572</link>	
  	<description>This is one of those times you really need to link to an example (yes, self links are allowed).</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.51998-785572</guid>
  	<pubDate>Wed, 29 Nov 2006 15:01:59 -0800</pubDate>
  	<dc:creator>cillit bang</dc:creator>
</item>
<item>
  	<title>By: DrJohnEvans</title>
  	<link>http://ask.metafilter.com/51998/My-Text-Runneth-Over#785649</link>	
  	<description>Yes, any number of things could be going wrong here.  If this happened to me, first things I would do is &lt;a href=&quot;http://validator.w3.org/&quot;&gt;validate&lt;/a&gt;:  both my original source, and my post-insertion generated source.&lt;br&gt;
&lt;br&gt;
(The &lt;a href=&quot;https://addons.mozilla.org/firefox/60/&quot;&gt;Firefox web developer toolbar&lt;/a&gt; is your friend.)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.51998-785649</guid>
  	<pubDate>Wed, 29 Nov 2006 16:00:44 -0800</pubDate>
  	<dc:creator>DrJohnEvans</dc:creator>
</item>
<item>
  	<title>By: Emperor SnooKloze</title>
  	<link>http://ask.metafilter.com/51998/My-Text-Runneth-Over#785660</link>	
  	<description>Ditto on the link, please, and what platform/browser you&apos;re seeing problems in.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.51998-785660</guid>
  	<pubDate>Wed, 29 Nov 2006 16:12:56 -0800</pubDate>
  	<dc:creator>Emperor SnooKloze</dc:creator>
</item>
<item>
  	<title>By: drjimmy11</title>
  	<link>http://ask.metafilter.com/51998/My-Text-Runneth-Over#785748</link>	
  	<description>is it because it&apos;s a very long text string with no spaces? if so, then it will bust out of a table or div- there is a css property which i dont recall right now, but it can be used to force word wrap...&lt;br&gt;
&lt;br&gt;
I dont think using innerHTML should break word wrap, but I could be wrong. You could also try having a table inside yoru div- they tend to be more &amp;quot;sturdy.&amp;quot;</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.51998-785748</guid>
  	<pubDate>Wed, 29 Nov 2006 17:30:40 -0800</pubDate>
  	<dc:creator>drjimmy11</dc:creator>
</item>
<item>
  	<title>By: Khalad</title>
  	<link>http://ask.metafilter.com/51998/My-Text-Runneth-Over#786033</link>	
  	<description>&lt;i&gt;I have a feeling, the browser cannot perform its normal text-wrapping because I am adding the HTML after the fact.&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
No, that&apos;s not the problem. Browsers are very, very good about handling JavaScript page modifications correctly. Some possible reasons off the top of my head:&lt;br&gt;
&lt;br&gt;
* You have long words that don&apos;t wrap, or have non-breaking spaces (&lt;code&gt;&amp;amp;nbsp;&lt;/code&gt;) in there.&lt;br&gt;
* Your &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; is wider than the page for whatever reason, which makes the text go beyond the screen edge. Maybe it has 100% width and its parent element is really wide, or maybe there&apos;s a wide image inside the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;.&lt;br&gt;
* You&apos;re in a &lt;code&gt;&amp;lt;pre&amp;gt;&lt;/code&gt; element.&lt;br&gt;
* Your &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; has the CSS rule &amp;quot;white-space: nowrap&amp;quot; applied to it some how.&lt;br&gt;
* Your &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; has a non-default value for the &amp;quot;overflow&amp;quot; CSS property.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.51998-786033</guid>
  	<pubDate>Wed, 29 Nov 2006 21:01:10 -0800</pubDate>
  	<dc:creator>Khalad</dc:creator>
</item>
<item>
  	<title>By: Invoke</title>
  	<link>http://ask.metafilter.com/51998/My-Text-Runneth-Over#786177</link>	
  	<description>Khalad has it right, the browser will not have any problem wrapping once the CSS is correct.  But to be honest, I usually don&apos;t use such &amp;quot;low level&amp;quot; javascript any more (manipulating innerhtml directly), due to the constant pain of trying to make IE obey anything close to the javascript every other browser seems to understand.  &lt;br&gt;
&lt;br&gt;
Instead, I use frameworks such as &lt;a href=&quot;http://jquery.bassistance.de&quot;&gt;jquery&lt;/a&gt; which make adding html this easy:&lt;br&gt;
&lt;br&gt;
$(&apos;#example&apos;).html(&apos;here is some html which will get subbed into the html of the #example div&apos;);</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.51998-786177</guid>
  	<pubDate>Wed, 29 Nov 2006 23:06:18 -0800</pubDate>
  	<dc:creator>Invoke</dc:creator>
</item>

    </channel>
</rss>
