sorry, I may have oversimplified my example above, replace alert
("content Loaded"); with this:

$("#childInput").change(function()
{
alert("input changed!");
});

so I want to add an event to a DOM element in the loaded page so the
DOM has to be ready before I can execute the code. The method you
suggest will work fine for alerts, but it doesn't seem to work for
adding events like above, at least not in IE.

Thanks.

On Dec 16, 9:33 am, rernens <robert.ern...@look2bookonline.com> wrote:
> There is no need to run $(document).ready when loading a page with
> ajax using
> jQuery. The scripts contained in the loaded content are automatically
> evaluated after the load has been successfull. You should insert at
> the end of the document you are loading
> <script type="text/javascript">
> alert("content loaded")
> </script>
>
> It will work flawlessly in both browsers.
>
> On 16 déc, 17:13, davidgregan <davidgre...@gmail.com> wrote:
>
> > I'm using a $.get call to get the contents for a dialog box and I'm
> > trying to run the $(document).ready on the ajax return like so:
>
> > parentPage.html:
> > $.get('desiredContent.html',function(data){
> > $("#dialogBoxDiv").html(data);
> > $("#dialogBoxDiv").dialog('open');
>
> > }
>
> > desiredContent.html:
> > $(document).ready(function() {
> > alert("content loaded!");
>
> > });
>
> > this works fine for firefox, but ie won't run the $(document).ready()
> > function on the desiredContent page. Is there a way to do this that
> > will work in both firefox and ie?
>
> > Thanks!

Reply via email to