buti Posted November 15, 2005 Share Posted November 15, 2005 could anyone help?i am trying to replace file: <img src="files/xxxxxx.jpg"> with rotate.html which is inside <div> ie. <div align="center"><img src="files/xxxxxx.jpg"></div>in the php page Link to comment Share on other sites More sharing options...
actionsketch Posted November 16, 2005 Share Posted November 16, 2005 you can change the information within a div by using .innerHTML... like this: <div id="changeme" align="center"><img src="files/xxxxxx.jpg"></div><script>document.getElementById('changeme').innerHTML = "rotate.html";</script> but I assume you want to actually display the contents of rotate.html... which means you'll need to use an Iframe to display it, or just get rid of rotate.html all together and have javascript write what ever rotate.html would have contained using the example above. Link to comment Share on other sites More sharing options...
MadPotato Posted November 16, 2005 Share Posted November 16, 2005 ...or you can learn some Ajax, aka XMLHttpRequest...you can find how to do it right here in www.w3schools.com, in the XML section Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now