Laura (lozette) wrote in ajaxengine,
Laura
lozette
ajaxengine

  • Location:

Prototype problems

I hope Prototype questions are OK in here...

I think I've found a bug in Prototype.js, but am not sure how/where to report it, since the Rails spinoffs mailing list seems to be in suspended animation (and I can't seem to join it), and Sam Stephenson himself isn't contactable. Frustrating.

I have some code in an iFrame which attempts to update divs in its parent window.

<script type="text/javascript" src="{$context}/javascript/prototype.js"></script>
<script language="javascript">
div2 = window.parent.document.getElementById('details');
div2.innerHTML = "";
</script>


Running this script gives me the following error in Firefox 1.5:

$A is not defined prototype.js (line 48)
$A is not defined prototype.js (line 48)


(FWIW I'm using the totally vanilla unaltered 1.4 version of Prototype.js).

After a bit of sniffing around it appears that if I remove the import of the Prototype library, the error disappears. But I need the library to be imported, as I'm using Prototype elsewhere on the page.

I'd read that Prototype does tend to hijack all JavaScript on a page, so I tried instead to use the Prototyped version of innerHTML, Element.update(div2, ""); This, however, makes it worse, and I get the following error:

uncaught exception: [Exception... "Component returned failure code:0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIDOMJSWindow.setTimeout]"nsresult: "0xc1f30001 (NS_ERROR_NOT_INITIALIZED)" location: "JS frame:: http://localhost:8080/javascript/prototype.js ::anonymous :: line 952" data: no]


...which appears to be something to do with a bug in XMLHTTPRequest in Mozilla (from Quirksmode).

Aargh. It's driving me up the wall. Anyone got any ideas?
  • Post a new comment

    Error

    default userpic
  • 0 comments