innerHTML ?
- Started
- Last post
- 8 Responses
- versa
can innerHTML for divs be used to pull in a separate page, and not just the html calling that page
i am interested in it as an alternative to iframes
thanks
- sparker0
why not use ssi or php includes for this?
- versa0
well ideally i would want to be able to dynamically change (with js) content in that div based on its id name
you're right, but, ssi and (i only know a little php)
will only solve the problem of initially getting the page loaded into the div, right?once the initial page is loaded
(into an iframe, but hopefully something else) i was trying to find another way to change that content pagewhoa, maybe i am not making sense
- sparker0
no, you can create dynamic pages that are included into another page via ssi.
example:
if you have a perl file that updates a news page, and that news page perl file is including in your html page ( via ssi ) that perl file can change dynamically every time you make updates.
same with php.
i'm sure the same can be accomplished via inner html, but i would be concerned about browser compatibility at that point.
- gabriel_pc0
So you're trying to make the content on the page change AFTER it's been loaded into the browser, right?
The only way I've heard of that being done would be with a 3rd party app or plugin. (flash,java applet, etc...)
- ape0
yeah you can get the ID of the element and change the innerHTML:
document.all("IDname").innerHTML...
but it won't work for older browsers and you gotta do getElementById("Id") for ns.
- Edo0
Yes you can using a hidden frame or an IFRAME
- Edo0
The trick is to target the right objects. if you use an IFRAME this would be on the page itself: document.getElementById("IFRAME... Using an Hidden Frame you have to target it from the toplevel -> top.framename.innerHTML
- versa0
i was originally interested in changing div content without putting an iframe in it
since iframes are not really XHTML compliant, and innerHTML isn't really DOM 2 compliant, i am just trying to find middle ground
to get back to it -
i thought maybe i make the innerHTML property of a div, the url to a new page rather than using an iframe to call that new pagethanks for the patience of those with more expertise