Closed Bug 409230 Opened 17 years ago Closed 16 years ago

Error Console gives "not well-formed" message when extension uses Ajax to grab text file

Categories

(Toolkit Graveyard :: Error Console, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 311724

People

(Reporter: brettz9, Unassigned)

Details

(Whiteboard: DUPEME 311724?)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2) Gecko/2007121120 Firefox/3.0b2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2) Gecko/2007121120 Firefox/3.0b2

The Error Console gives "not well-formed" messages when my extension (Unicode Input Tool/Converter) uses Ajax to retrieve data from a plain text file (.txt) and used with responseText.

Reproducible: Always

Steps to Reproduce:
1. Use chart view (in Unicode Input Tool/Converter extension at https://addons.mozilla.org/en-US/firefox/addon/5235 )
2. Hover mouse over a chart item to trigger Ajax to retrieve via responseText from the file Unihan.txt
3. Watch the Error Console spit out the errors
Actual Results:  
Error: not well-formed
Source File: file:///C:/Documents%20and%20Settings/myUsername/Application%20Data/Mozilla/Firefox/Profiles/myProfile/extensions/charrefunicode@brett.zamir/data/UnicodeData.txt
Line: 1, Column: 5
Source Code:
0000;<control>;Cc;0;BN;;;;;N;NULL;;;;

Expected Results:  
No errors
AMO reports that extension is compatible with "Firefox: 1.5 – 3.0a8" and you're on 3.0b2...
Sorry, I corrected the addon site information. It does work otherwise with 3.0b2
What happens if you specify a content type?

 		request.open("GET", url);
+		request.overrideMimeType('text/plain');
 		request.send(null);
That causes the message to disappear... Though I wouldn't think I'd need that to open a .txt file opened with responseText, no?
See Bug 311724 for a discussion on this issue.
Whiteboard: DUPEME 311724?
Product: Firefox → Toolkit
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.