Ide ais to start excecution when ontents in loaded. So you should put only
your ently point call there. Other functions/vars etc may be anywhere.

Best regards,
Konstantin Mirin
 
mailto:konstantin.mi...@gmail.com
mailto:i...@konstantin.takeforce.net


> -----Original Message-----
> From: jquery-en@googlegroups.com 
> [mailto:jquery...@googlegroups.com] On Behalf Of 123gotoandplay
> Sent: Saturday, February 07, 2009 1:39 PM
> To: jQuery (English)
> Subject: [jQuery] Re: How to enable jquery in a loaded page?
> 
> 
> 
> hmm, so i need to put all the javascript, i have in 
> showContent.php's $ (document).ready(function () {
> 
> in a callback function??
> 
> Can i leave the other js functions in showContent.php or 
> should i copy those function into my "base" php file??
> 
> regards,
> 
> 
> 
> On 6 feb, 15:33, ilovejquery <ilovejqu...@gmail.com> wrote:
> > It's probably because your jquery code is in $(document).ready() 
> > function and it is never fired when you load with .load().
> >
> > Put your code in callback function like this:
> >
> > $(document).ready(function() {
> >        $("#show").click(function() {
> >                $("#content").css("overflow-y", "scroll");
> >        $("#content").load("showContent.php", function(){
> >
> > // your code here...
> >
> > });
> >
> >                });
> >
> > ----
> > Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com
> >
> > On Fri, Feb 6, 2009 at 6:40 PM, 123gotoandplay 
> > <wesweatyous...@gmail.com> wrote:
> >
> > > Hi there,
> >
> > > I am having a problem to enable jquey in a loaded page.
> >
> > > For example:
> >
> > > base.php has jquery and i load showContent.php like:
> >
> > > $(document).ready(function() {
> > >        $("#show").click(function() {
> > >                $("#content").css("overflow-y", "scroll");
> > >        $("#content").load("showContent.php");
> > >                });
> >
> > > but now the jquery in showContent.php doesn't work.
> >
> > > if i directly browse to showContent.php the jquery does work
> >
> > > Any tips?

Reply via email to