A few random things:

I don't think this is the problem, but <span>s are lousy containers:
    http://webdesign.about.com/od/htmltags/p/aaspantag.htm
Might be worth, at the start, making sure your page validates. Again,
it's probably not the problem -- but if it *is* the problem you'll
drive yourself nuts debugging.
  http://validator.w3.org/

Using safari's inspector or firefox's firebug, view the raw text sent
back by the server. In Safari 4, you use the resources tab; watch for
a new block to appear at the bottom and then look at its contents.
Firebug is similar. (The tamper data firefox plugin is a more
chainsaw-ish approach).

Does the response look like HTML or plain text?
If you do a Save As on the un-edited HTML page, and then manually
copy-paste the response into the block jQuery is inserting, does the
page look right? Does it validate?

On Sun, Sep 13, 2009 at 6:54 PM, Robert Banh <[email protected]> wrote:
>
> oh i get it now... yeah that happens if u're using the .text() method
> of jquery... but you're saying the .html() method also causes that
> behavior?
>
>
>
> On Sun, Sep 13, 2009 at 6:48 PM, Paul <[email protected]> wrote:
>>
>> Robert,
>>
>> Not sure I understand your suggestion on using <pre> should I wrap
>> that around my span?
>>
>> In Firebug when I get the value of the textarea element is does
>> contain the '\n\n' newlines. As I mentioned I found and used a JS
>> routine that functions like the PHP nl2br which basically replaces the
>> '\n' with '<br />'. The problem then is the '<br />' displays
>> literally as '<br />' in the span text instead of an actual break.
>>
>> P-
>>
>>
>>
>>
>>
>> On Sep 13, 2009, at 6:25 PM, Robert Banh wrote:
>>
>>>
>>> are the newlines being removed by jquery? try <pre> or <xmp> tags?
>>>
>>> if you use firebug to view the dynamic data in the span tag, does it
>>> display newlines in there?
>>>
>>> rob
>>>
>>>
>>>
>>> On Sun, Sep 13, 2009 at 6:15 PM, Paul <[email protected]> wrote:
>>>>
>>>> Greetings all,
>>>>
>>>> Working on the JS/jQuery this rainy Sunday afternoon. I've trying to
>>>> capture submit on a form and update a span on the page with the value
>>>> from the textarea. The mechanics of submit intercept and updating the
>>>> field is somewhat trivial. What I've having trouble with is the
>>>> formatting of the span. The value of the span when the page is loaded
>>>> may contain 1-n number of paragraphs. When the user submits the form
>>>> when I update the span via jQuery text() or html() I loose all
>>>> formatting. In other words no breaks on the paragraphs. I've even
>>>> tried adding some nl2br JS code I found but this just puts the <br />
>>>> code into the span but it doesn't get rendered by the browser.
>>>>
>>>> Sadly this is part of a large plugin I'm working on so can't really
>>>> provide sample code.
>>>>
>>>> Any thoughts would be appreciated.
>>>>
>>>> Paul
>>>>
>>>>>
>>>>
>>>
>>> >
>>
>>
>> >
>>
>
> >
>



-- 
http://www.infochimps.org
Connected Open Free Data

--~--~---------~--~----~------------~-------~--~----~
Our Web site: http://www.RefreshAustin.org/

You received this message because you are subscribed to the Google Groups 
"Refresh Austin" group.

[ Posting ]
To post to this group, send email to [email protected]
Job-related postings should follow http://tr.im/refreshaustinjobspolicy
We do not accept job posts from recruiters.

[ Unsubscribe ]
To unsubscribe from this group, send email to 
[email protected]

[ More Info ]
For more options, visit this group at 
http://groups.google.com/group/Refresh-Austin
-~----------~----~----~----~------~----~------~--~---

Reply via email to