From: Scott A. L. <sc...@sc...> - 2000-12-06 20:15:16
|
You should be able to use an afterload event to trigger the iteration through the layer's document. Assuming the document is not from another domain, you could use this to rewrite all links. The loadpanel and loadHTML extension both already attach the calling layer as a property to the link, as .lyrobj, so you could just extend this loop to rewrite the link as well: - assign the calling layer as a property of the link (in .lyrobj) - preserve the original href somehow, like: links[i]._href = links[i].href - replace the existing href with a void return: links[i].href = "javascript:void(0);" - assign an onclick handler to the links: links[i].onclick = LoadPanel.handleClick Then all you have to do is write the handleClick: LoadPanel.handleClick = function(){ this.lyrobj.loadHTML(this._href) } I suppose you could also change other things in the link, like the status bar message and whatnot. This would probably work for pure navigation links, not for links that already use the "javascript:" protocol. That would cause some weird problems. scottandrew Bill Wheaton wrote: > > Perhaps, after the page loads, you could go and get the loadpanel's > document.links array, and the iterate through them all and add to them a > target window, namely the layer you want them to show up in. I hope this > works, because I plan on doing something like that. > > "Cameron Hart" <ca...@bi...> wrote: > > > I'm not sure if this is what you're looking for, but why not try > > > something like ... > > > > > > <a href="#" onClick="whateverLayer.setHTML('page.html')">My Link</a> > > > > > > If you don't know what whateverLayer is in adavnce, you could use > > > document.write to change the name of the layer. > > > > that works if you know what whatevenLayer is, but unfortunately I don't. I > > thought that the document loaded into the loadpanel would know what > > whateverLayer is (ie the layer it got loaded into) but it doesn't seem to. > > > > I'm not what you mean by using document.write to change the name of the > > layer? > > > > Thanks, > > > > Cameron. > > > > > > > > Let me know if you come across a better solution, or indeed if > > > anyone has come across a > > > solution to submitting a form and giving it a target inside a loadpanel. > > > > > > Mark > > > > > > Cameron Hart wrote: > > > > > > > I've got a question about links inside html files loaded into a > > > loadpanel. > > > > > > > > I am building a site that uses multiple loadpanels at the same time. > All > > > > these loadpanels contain external html documents. Some of these > > > documents > > > > have links in them. If you click on a link in a document loaded in a > > > > loadpanel, it loads the new page over the top of the main > > > window, not into > > > > the loadpanel. That's not good ;-) > > > > > > > > I've tried making the links javascript calls to call a setURL > > > to load a new > > > > document in the same loadpanel. The problem is that the > > > document inside the > > > > loadpanel doesn't seem to be "aware" of what loadpanel it is > > > in. It's parent > > > > appears to be the top level DynDocument, not the LoadPanel object. > > > > > > > > Does anyone have any ideas on how I can tell a document loaded into a > > > > loadpanel, this is your loadpanel, use setURL on this? > > > > > > > > Thanks, > > > > > > > > Cameron. > > > > > > > > _______________________________________________ > > > > Dynapi-Help mailing list > > > > Dyn...@li... > > > > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > > > > > > _______________________________________________ > > > Dynapi-Help mailing list > > > Dyn...@li... > > > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > > > > _______________________________________________ > > Dynapi-Help mailing list > > Dyn...@li... > > http://lists.sourceforge.net/mailman/listinfo/dynapi-help > > ____________________________________________________________________ > Get free email and a permanent address at http://www.netaddress.com/?N=1 > _______________________________________________ > Dynapi-Help mailing list > Dyn...@li... > http://lists.sourceforge.net/mailman/listinfo/dynapi-help -- scott andrew lepera ----------------------------------- web stuff: www.scottandrew.com music stuff: www.walkingbirds.com |