|
#1
| |||
| |||
| Loading external pages/seperate pages in a div Is there anyway, through javascript and the DOM (or any other way) to load any specified html file into a div, so in a way the div is used like a frame would be? I am just trying to find a way to replace frames with divs alone. I know how to set a div's HTML through javascript but I don't know how to load any external html. I have been searching and have not yet found a way. I expect that if there is a way, it is ugly and not worth it. Let me know if you have a way to do it, its probably more of geek wanting to know how something works more than practical use. |
|
#2
| ||||
| ||||
| xmlhttprequest can load html (porbably not a whole page though cos there'd be 2 body/head tags) into a div, Apple have a tutorial - http://developer.apple.com/internet/...mlhttpreq.html and I'm working on a web-based Delicious Library which uses it - http://www.dottom.co.uk/library/ (really not finished)
__________________ PowerBook G4 1.25Ghz, 15", 1GB, 80GB,SuperDrive, 10.4 MacMini, 1.25Ghz G4, 256MB (will be upgraded), 80GB, Combo Drive, 10.4 20GB iPod (4G) eMate 300, Newton OS 2.1, Bluetooth Newton MessagePad 2000, Newton OS 2.1, WiFi, Bluetooth NeXT Turbo Colour, NeXTStep 3.3 TomPhippen.com dogtanian.net |
|
#3
| ||||
| ||||
| i wish this could be done easilly. The only way is to have an iframe within the div tag thgen target that iframe.... |
|
#4
| |||
| |||
| Quote:
|
|
#5
| ||||
| ||||
| Perhaps this is a stupid question, but is there any reason not to use PHP? It may depend on what exactly you are trying to achive and PHP may not be the best solution, but anyway ... Code: <?php include "filename"; ?>
__________________ This is not a signature (but I could be wrong). 15" MacBook Pro C2D@2.4 GHz | 2 GB RAM | Mac OS 10.5.4 | Website | LinkedIn | Publications GP/O d-(+)@ s: a->? C++(+++) U* P+ L+>++ !E---- W+++ N o? K? w--- O? M++ V? PS+++ PE-- Y+ PGP t 5? X- R !tv b++++ DI+(++)@ D+(++) G++(+++) e+++$>++++$$ h--->---- r+++ y++++@ |
|
#6
| |||
| |||
| Quote:
|
|
#7
| ||||
| ||||
| Quote:
You're probably better off in the long run keeping it more 'traditional' as separate pages. That'll go better towards standards compliance and accessibility/usability.
__________________ . | mdnky@macosx.com | My Homepage | My Music | Restore the Pledge | MacOSX.com Widget | • MacBook Pro Core2Duo 2.33GHz 15", 2GB DDR2 RAM, 120GB, DL Superdrive, OS X 10.5, • Apple 23" Cinema HD Display, Apple Slim-Stainless Keyboard, Logitech Optical Scroll Mouse • iPhone 8GB, iPod Photo 30GB, Nikon D50, Nikon L6, Epson 3490, Epson R1800, HP LaserJet 1200 • LaCie 500GB d2 Quadra, LaCie 160GB d2 FW, harman/kardon SoundSticks II, Mighty Mouse, iSight |
|
#8
| ||||
| ||||
| i think he wants to make divs load external documents without complete page reload, is this right hateeternal? If so, this cannot be done, you need to have an iframe the dimensions of your div and target the iframe in the nav. You will be able to still hide and show the div's with JS. But I totally agree there should be something like <div src="your_externaldoc.php"> |