[uf-rest] AHAH! Not yet.
Ernest Prabhakar
prabhaka at apple.com
Wed Jan 4 15:43:19 PST 2006
On Jan 4, 2006, at 3:18 PM, Dr. Ernie Prabhakar wrote:
> Hmm. What if you added 'id=body' to your inner HTML, and try that
> first? Would that eliminate the extra tags? That seems clearer,
> and at least doesn't complicate the API.
Doh! My bad, I didn't pay close enough attention to the goal of using
responseText vs. responseXML.
Given that, the choice is between:
a) giving up going to responseXML
b) Manually parsing responseText to strip out unwanted tags
c) Living with some messy link/meta tags sprinkled in the HTML
Frankly, given those choices, I'm starting to lean more towards (c);
at least link and meta have no body text, so they'll be invisible.
And any overhead for the browser is probably way less than it would
take for JavaScript to parse it.
True, it would look strange for any poor soul reading the source, but
anybody crazy enough to do that would probably enjoy the weirdness. ;-)
Or am I overlooking something else?
-- Ernie P.
>
> -- Ernie P.
>
> On Jan 4, 2006, at 3:12 PM, Justin Maxwell wrote:
>
>> On 4 Jan 2006, at 14:43, Dr. Ernie Prabhakar wrote:
>>
>>> If I'm right, then this is even more obnoxious than I thought.
>>> What did you think of my suggestion of adding a "source" div to
>>> the AHAH call? Would that actually make your life simpler, by
>>> allowing you to 'host' all your AHAH fragments on a single page?
>>
>> I think we can be even more specific than that: source is "body".
>> Part of the attraction to AHAH, for me, is its conceptual
>> simplicity. I already feel like I'm cheating by passing
>> functions to it, but I need that for my application.
>>
>> There would be two ways off the top of my head to do this while
>> still respecting AHAH's use of responseText instead of responseXML.
>>
>> 1. regexp match relevant content (ALL content NOT INCLUDING
>> content type declarations or <head>.*</head> elements.
>>
>> 2. dump the content in as usual, and remove any nodes matching
>> 'link', 'title' or 'meta' from the destination node
>>
>> The response text contains everything -- body tag and all, but
>> once it's assigned to a node via innerhtml (even an "html" element
>> created via createElement), it loses the body. So we can't
>> getElementsByTagName('body'). I think option 1 is pretty solid,
>> but I'd like to hear other opinions on it.
>>
>>
>>
>>
>> _______________________________________________
>> microformats-rest mailing list
>> microformats-rest at microformats.org
>> http://microformats.org/mailman/listinfo/microformats-rest
>
More information about the microformats-rest
mailing list