# Javascript Dialogs and AJAX

**URL:** <https://www.ruby-forum.com/t/javascript-dialogs-and-ajax/66019>\
**Category:** Rails\
**Created:** [August 22, 2006, 10:27pm UTC](https://www.ruby-forum.com/t/javascript-dialogs-and-ajax/66019 "2006-08-22T22:27:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [August 22, 2006, 10:27pm UTC](https://www.ruby-forum.com/t/javascript-dialogs-and-ajax/66019/1 "2006-08-22T22:27:46Z")

</div>

I’ve tried using libraries such as Lightbox, ThickBox, or iBox for  
dialogs in my Rails apps (for example, thickbox is at

> **[Cody Lindley | Front-end/Client-side/JavaScript Engineer | Boise,Idaho](https://codylindley.com/Javascript/257/thickbox-one-box-to-rule-them-all)**
>
> Cody Lindley is a front-end/JavaScript developer and recovering Flash developer. He has an extensive background working professionally (25+ years) with HTML, CSS, JavaScript, and client-side performance techniques as it pertains to web development....

). They work great for simple stuff, but when I use them to host forms  
and try to update divs inside the dialogs, I get weird results… like  
RJS javascript outputs directly to the screen instead of being  
executed.

Has anyone tried updating dialogs like this? What libraries have you  
used.

Thanks,  
phil

---

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [August 22, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/javascript-dialogs-and-ajax/66019/2 "2006-08-22T23:45:59Z")

</div>

On 8/22/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve tried using libraries such as Lightbox, ThickBox, or iBox for  
> dialogs in my Rails apps

I’ve had poor luck using those types of libraries for dialogs. I’ve  
had good luck, on the other hand, with the YUI Dialogs:

[http://developer.yahoo.com/yui/container/dialog/index.html](http://developer.yahoo.com/yui/container/dialog/index.html)

It’s fairly powerful and quite stable. In general, once you get the  
hang of Yahoo’s conventions – and the limitations of the library –  
it works very well.

We started to use it for Lingr – [http://lingr.com](http://lingr.com) – but decided that  
we couldn’t justify forcing that much JS on chatters just for a  
sign-in dialog. That’s the downside of using YUI: even if you only  
want a little, you have to accept a lot.

–  
Chris B., Hypsometry  
[http://hypsometry.com/](http://hypsometry.com/)  
Web Application Design & Development

---

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [August 23, 2006, 8:56am UTC](https://www.ruby-forum.com/t/javascript-dialogs-and-ajax/66019/3 "2006-08-23T08:56:48Z")

</div>

removed\_email\_address@domain.invalid wrote:

> I’ve tried using libraries such as Lightbox, ThickBox, or iBox for  
> dialogs in my Rails apps (for example, thickbox is at  
> [Cody Lindley | Front-end/Client-side/JavaScript Engineer | Boise,Idaho](http://codylindley.com/Javascript/257/thickbox-one-box-to-rule-them-all)  
> ). They work great for simple stuff, but when I use them to host forms  
> and try to update divs inside the dialogs, I get weird results… like  
> RJS javascript outputs directly to the screen instead of being  
> executed.

I used Lightbox (the

> **[Particletree » Lightbox Gone Wild!](http://particletree.com/features/lightbox-gone-wild/)**
>
> Particletree is the beginning of something. This place, this collection of knowledge, is a gathering of forces, a sharpening of skills.

version) with rjs quite heavily, while it worked well. You might want to  
check if the rjs response comes back with the proper content type.  
Normally this is the case, unless your app was developed with an earlier  
rails version and you have left set\_content\_type kind of filter in. A  
quick test would be rjs templates without lightboxes.

## zsombor

Company - [http://primalgrasp.com](http://primalgrasp.com)  
Thoughts - [http://deezsombor.blogspot.com](http://deezsombor.blogspot.com)

---

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [August 23, 2006, 1:10am UTC](https://www.ruby-forum.com/t/javascript-dialogs-and-ajax/66019/4 "2006-08-23T01:10:11Z")

</div>

take a look at DOJO Toolkit.

[http://dojotoolkit.org/](http://dojotoolkit.org/)

Jim

> > dialogs in my Rails apps  
> > We started to use it for Lingr – [http://lingr.com](http://lingr.com) – but decided that  
> > we couldn’t justify forcing that much JS on chatters just for a  
> > sign-in dialog. That’s the downside of using YUI: even if you only  
> > want a little, you have to accept a lot.
> 
> –  
> Chris B., Hypsometry  
> [http://hypsometry.com/](http://hypsometry.com/)  
> Web Application Design & Development
> 
> >

* * *

Get the new Windows Live Messenger!  
[http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline](http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline)

---

<div class="post-metadata">

**Author:** ![philswenson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7feea3/32.png) [@philswenson](https://www.ruby-forum.com/u/philswenson)\
**Post date:** [August 23, 2006, 9:50am UTC](https://www.ruby-forum.com/t/javascript-dialogs-and-ajax/66019/5 "2006-08-23T09:50:52Z")

</div>

I’d recommend using prototype-windows. It’s advantage is it’s based on  
the prototype library already included with rails.

[http://prototype-window.xilinus.com/](http://prototype-window.xilinus.com/)
