Have you enabled debugging in Safari? Does the console show any error messages?

>From some examples I found, it looks like people use "res.responseXML"
directly, without the ".documentElement" part. I guess you should also
check for malformed XML in the response. Here is some relevant
documentation from Apple Developer Connection:

More powerful, however, is the XML document object in the responseXML
property. This object is a full-fledged document node object (a DOM
nodeType of 9), which can be examined and parsed using W3C Document
Object Model (DOM) node tree methods and properties. Note, however,
that this is an XML, rather than HTML, document, meaning that you
cannot count on the DOM's HTML module methods and properties. This is
not really a restriction because the Core DOM module gives you ample
ways of finding element nodes, element attribute values, and text
nodes nested inside elements.

/Per

On Dec 28, 2007 12:49 AM, Steve Zatz <[EMAIL PROTECTED]> wrote:
>
> First of all, I am an inexperienced javascript programmer (so you're
> forewarned) and appreciate any help with the following problem.  I
> have googled this every which way but can't find anything relevant.
>
> I am using the current trunk of Mochikit.
>
> I have a simple Web application that lists items and I am using AJAX
> to display a detailed note on a particular item if the user requests
> it.  The application works as expected for IE and Firefox but does not
> work on Safari (version 3.0.4 running on Leopard).
>
> When the user requests a note on an item, the following javascript
> function is executed:
>
> function show_note(obj)
> {
>     var id = obj.parentNode.id;
>     var res = doSimpleXMLHttpRequest('get_note/'+id);
>     res.addCallback(show_note_response);
> }
>
> and show_note_response looks like:
>
> function show_note_response(res)
> {
>     var response = res.responseXML.documentElement;
>     var id = response.getElementsByTagName('id')[0].firstChild.data;
>     var p = response.getElementsByTagName('p')[0];
>
>     var note_div = DIV({'id':id+'d','class':'note'},p)
>     appendChildNodes(id, note_div);       //id is the id of the item
> that was clicked on
> }
>
> When using Safari (or IE or Firefox), I can see the server receive the
> 'get_note' request and I can see the server respond with something
> like:
>
> <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?><response><id>627</id><p
> xmlns="http://www.w3.org/1999/xhtml";>Some text ...</p></response>
>
> When using IE and Firefox the note displays below the item as expected
> but on Safari nothing happens and I am not sure what the problem is or
> how to debug it.  Thanks for any suggestions.
>
> Steve
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to