[Seaside] debugging javascript within browsers is hard when the browser show the response on a single line

Nick Ager nick.ager at gmail.com
Sun Aug 7 10:40:20 UTC 2011


I wonder if other people suffer from the same problem when debugging

Seaside's response is viewed by browsers as a string without line-breaks.
Normally this isn't a problem as the browser "pretty-prints" the output when
inspecting the html.
However when debugging javascript, either inline or within a file-library
the script debugger (I'm currently using Mac Safari) shows the output as a
single line - which makes it impossible to interpret any javascript
generated errors ("syntax error: line 1"!!) or to set meaningful

I've discovered that calling #withInternetLineEndings on the file-library
string results in browsers interpreting the line-endings as expected.

Locally when I'm debugging I've created a class derived from WAHtmlDocument,
which overrides #nextPutAll:
WAHtmlDocumentWithInternetLineEndings>>#nextPutAll: aString
    super nextPutAll: aString withInternetLineEndings

and I modify WAFileLibrary>>#handle: modifying the WAResponse>>#document:
document: ((self documentForFile: fileName) withInternetLineEndings)

Is there a better solution? Are there easier workarounds, browser settings

I created an issue for this problem:

Though if there are easy workaround that I've missed, I'd be delighted to
close the issue.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110807/1c1c92c6/attachment.htm

More information about the seaside mailing list