or again... in this case, if you want to avoid the plugin use, you
could load also the javascript within the html file...

FILE_TO_LOAD.php

<?php

echo <<<END
<script type="text/javascript" >
   $(document).ready(function(){

                       /* DO SOME jQuery CODE.... */
   };
</script>

<div >

                       /* DO SOME HTML CODE.... */
</div>
END;
?>

byeee...

On May 3, 2:41 pm, "^AndreA^" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I think it's a normal issue with jQuery, and happens to everyone
> before or late... ;-)
>
> The problem is that when you load the whole DOM at the beginning, the
> external html file is not loaded yet... and so It doesn't exist at
> all.
> Then you load it but it's not bound to any event... that's the
> problem!
>
> You could avoid this problem by using a plugin, livequery plugin works
> pretty well for me...
>
> You can find it here:http://plugins.jquery.com/project/livequery/
>
> Hope this helps
>
> On May 3, 7:58 am, Sid <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I've tried searching for a solution to this, but haven't found
> > anything.
>
> > I load an external html file into a div using .load()
> > The external file contains only a huge <div> tag with the id 'inText'
> > The CSS rules apply to it, but the jQuery doesn't.
>
> > However, when I put in an alert or a setTimeout between the load and
> > the next jQuery, it works perfectly.
>
> > 1)  The first issue here is that the next jQuery instruction is
> > executed before the external div has loaded. Is there a jQuery way to
> > check whether the load is complete? document.ready doesn't work here.
>
> > 2) The classes contained within the newly loaded div are not
> > recognised by jQuery. It's as if a snapshot was created of the
> > original DOM, but new additions are not recognised. For example, I
> > have a Downloads link on my mainpage with the class 'downloads'. This
> > works perfectly.
> > Then i have another 'downloads' class link on my 'Thanks To' page
> > (loaded from outside), and this doesn't work.
>
> > Check this athttp://sid-deswal.110mb.com
>
> > Regards
> > Sid

Reply via email to