Sorry, I meant click()s to live().
On 10月1日, 午前10:49, smwithdm <smwit...@gmail.com> wrote: > Chrazy, > > Thank you for your great info! > > I changed it as you said but didn't work. > I so looked at the api reference and did some homework and changed it > to the following and worked all fine! > I just had to change allload() to live()s. > > Once again, thank you and thank you to JQuery! > > ----- index.html ----- only changed places. > > <script type="text/javascript"> > $(document).ready(function(){ > $("#mainview").load("page01.html"); > $("#clickme").live("click", function(){ > $("#mainview").load("page02.html"); > }); > $("#clickme2").live("click", function(){ > $("#mainview").load("page03.html"); > }); > $("#clickme3").live("click", function(){ > $("#mainview").load("page04.html"); > });}); > > </script> > > ----- END of index.html changed places. ----- > > On 10月1日, 午前8:02, Chrazy <cwolg...@gmail.com> wrote: > > > > > You have to use the live() event. > > > So instead of: > > $("#clickme2").click(function(){ > > $("#mainview").load("page03.html"); > > }); > > > You write: > > > $("#clickme2").live('click', function(){ > > $("#mainview").load("page03.html"); > > }); > > > Functions will just work with objects already in the DOM unless you > > bind them with live. > > > On 1 Okt, 07:45, smwithdm <smwit...@gmail.com> wrote: > > > > I'm trying toloadapageusing the .load(url) from an alreadyloaded > > >page, but nothing responds. Below is a simple samplepagecreated to > > > show what I want to accomplish. > > > Also, I'm using JQuery 1.3. > > > > ----- index.html ----- > > > <html> > > > <head> > > > <script type="text/javascript" src="jquery.js"></script> > > > <script type="text/javascript"> > > > $(document).ready(function() { > > > $("#mainview").load("page01.html"); > > > $("#clickme").click(function(){ > > > $("#mainview").load("page02.html"); > > > }); > > > $("#clickme2").click(function(){ > > > $("#mainview").load("page03.html"); > > > }); > > > $("#clickme3").click(function(){ > > > $("#mainview").load("page04.html"); > > > });}); > > > > </script> > > > </head> > > > <body> > > > <div id="mainview"></div> > > > </body> > > > </html> > > > > ----- END of index.html ----- > > > > ----- page01.html ----- > > > > <html><head></head><body> > > > <p>This is page01.html</p> > > > <div id="clickme">Click Me!</div> > > > <p>some stuffs</p> > > > </body> > > > </html> > > > > ----- END of page01.html ----- > > > > ----- page02.html ----- > > > > <html><head></head><body> > > > <p>This is page02.html</p> > > > <div id="clickme2">Click Me!</div> > > > <p>some more stuffs again</p> > > > </body> > > > </html> > > > > ----- END of page02.html ----- > > > > ----- page03.html ----- > > > > <html><head></head><body> > > > <p>This is page03.html</p> > > > <div id="clickme3">Click Me!</div> > > > <p>some more stuffs again</p> > > > </body> > > > </html> > > > > ----- END of page03.html ----- > > > > When the index.htmlpageloads up, the page01.html loads into > > > #mainview. > > > And when I try to click on the <div id="clickme">Click Me!</div> > > > inside page01.html toloadpage02.html, nothing works. > > > > Just can't figure out what's wrong... If someone knows an easy trick, > > > please help me out. Thank You!