[Dojo-interest] Fetching HTML and invoking javascript with io.bind

David Schontzler schontz at gmail.com
Thu May 19 18:21:37 PDT 2005


On 5/19/05, Dror Matalon <dror at zapatec.com> wrote:
> 
> Thanks for spending the time to look at it.I also apologize in advance
> if I'm asking anything too obvious.
> 
> I understand the approach, and I can see how it would work with XMLHTTP,
> but wouldn't this break if the transport is iframe. By the way, Alex
> says in http://www.dojotoolkit.org/intro_to_dojo_io.html
>         if you want to be DARN SURE you're using the XMLHTTP transport, you
>                 can specify that too:
> 
> What other transport mechanisms are currently available and how do you
> specify them.

There's plans to add an IFRAME transport and probably a SCRIPT embed transport.

> Also what mime types are available? I see text/plain, text/javascript
> and, in your example, text/xml.

Those are the only 3 we "support". If you specify text/xml, it expects
the content to be an XML file (and, if not, attempts to make an XML
document out of it (work in progress)). If you specify
text/javascript, then it expects JS and attempts to run code returned
(basically, eval()). Everything else is treated as plain text and the
string of text is returned.

So, idealy, you should be able to accomplish your result the same way
no matter what transport layer you use. Since there are cases where
one tranport layer may make more sense (like your IFRAME example), you
will be able to specify the IFRAME transport and then set the mimetype
to text/html (or text/plain) and no extra "lifting" will be done.

> Finally, is there a version of io.bind package that is uncompressed and
> included the comments (and I don't mean the full package)? It'd make it a
> lot easier to provide more intelligent feedback.

We don't have one out, but we should be able to do that. If we don't
put it up as an official build, I can do it myself and toss it your
way.

-David


More information about the Dojo-interest mailing list