I''m continuing my work on integrating fckeditor with Rails. Currently I''m working on implementing the filebrowser / upload features, but I''ve ran into this problem. The response I get back is being loaded into the "responseText" property instead of the "responseXML" property. I''m trying to figure out why this is the case, but am coming up blank. The response is a well-formed xml document, and I''m sending the "content-type: text/xml; charset=utf-8" header. Is this an encoding problem? What do I need to do to make sure that my xml file is encoded in the correct manner? I have a feeling this is an encoding issue, but have been able to find anything that helps with this through google. Any help would be greatly appreciated! Thanks, Josh
On Wed, 2005-09-07 at 10:28 -0500, Josh Charles wrote:> I''m continuing my work on integrating fckeditor with Rails. Currently > I''m working on implementing the filebrowser / upload features, but > I''ve ran into this problem. > > The response I get back is being loaded into the "responseText" > property instead of the "responseXML" property. I''m trying to figure > out why this is the case, but am coming up blank. The response is a > well-formed xml document, and I''m sending the "content-type: text/xml; > charset=utf-8" header. Is this an encoding problem? What do I need > to do to make sure that my xml file is encoded in the correct manner? >Hi Josh, I had great success at using the steps on this site as a primer for xmlhttp and rails: http://people.freenet.de/schoefmax/howto/ajax_responses_with_xmlrpc/ There was a bug in the javascript library files listed on the page, but they seem to be updated with the fix now. It''s a really slick yet minimal way to get xmlhttp up and running, and the javascript library is a great example of how to handle the data. -Matt B> I have a feeling this is an encoding issue, but have been able to find > anything that helps with this through google. Any help would be > greatly appreciated! > > Thanks, > Josh > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
> Hi Josh, I had great success at using the steps on this site as a primer > for xmlhttp and rails: >FCKEditor requires that a certain xml schema be send back, so that page wasn''t very helpful. In this case, the required XML should be something like the following: <?xml version="1.0" encoding="utf-8" ?> <Connector command="GetFoldersAndFiles" resourceType="File"> <CurrentFolder path="/Samples/Docs/" url="/UserFiles/File/Samples/Docs/" /> <Folders> <Folder name="Documents" /> <Folder name="Files" /> <Folder name="Other Files" /> <Folder name="Related" /> </Folders> <Files> <File name="XML Definition.doc" size="14" /> <File name="Samples.txt" size="5" /> <File name="Definition.txt" size="125" /> <File name="External Resources.drw" size="840" /> <File name="Todo.txt" size="2" /> </Files> </Connector> This text is being returned by the request, only it is being put into the "responseText" property instead of the "responseXML" property. The rest of the FCKEditor code depends on it being in "responseXML" in order to use the call properly. Searching google, I found that "responseXML" will be null if the "responseText" cannot be parsed, but it stops there. The xml I''m returning is above, which is well formed. I have no idea why this is not working. What are other possible reasons the response cannot be parsed? I just can''t figure it out. Everything should be working. Josh
Ok, never mind. I found the bug na di must admit it was quite stupid. Because I''m used to php sending a header like this: header( "content-type: yadda/yadda" ) I had put in my code headers["Content-Type"] = "Content-Type:text/xml; charset=utf-8" Stupid. Stupid. Ok, the good news is that work should move quickly now getting the filebrowser and file upload completed. Thanks! Josh On 9/7/05, Josh Charles <josh.charles-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi Josh, I had great success at using the steps on this site as a primer > > for xmlhttp and rails: > > > > FCKEditor requires that a certain xml schema be send back, so that > page wasn''t very helpful. In this case, the required XML should be > something like the following: > > <?xml version="1.0" encoding="utf-8" ?> > <Connector command="GetFoldersAndFiles" resourceType="File"> > <CurrentFolder path="/Samples/Docs/" url="/UserFiles/File/Samples/Docs/" /> > <Folders> > <Folder name="Documents" /> > <Folder name="Files" /> > <Folder name="Other Files" /> > <Folder name="Related" /> > </Folders> > <Files> > <File name="XML Definition.doc" size="14" /> > <File name="Samples.txt" size="5" /> > <File name="Definition.txt" size="125" /> > <File name="External Resources.drw" size="840" /> > <File name="Todo.txt" size="2" /> > </Files> > </Connector> > > This text is being returned by the request, only it is being put into > the "responseText" property instead of the "responseXML" property. > The rest of the FCKEditor code depends on it being in "responseXML" in > order to use the call properly. > > Searching google, I found that "responseXML" will be null if the > "responseText" cannot be parsed, but it stops there. The xml I''m > returning is above, which is well formed. I have no idea why this is > not working. What are other possible reasons the response cannot be > parsed? I just can''t figure it out. Everything should be working. > > Josh >