Scriber
asked on
Display a file within a div
I have a page with two divs, one taking up 50% left and the other 50% right. I have links to files on the left and I'd like them to open on the right. I have commented the line of code required //pseudo code.
Thanks in advance!
//page.htm
function openFile(file) {
document.div("container_right") = file; //pseudo code
}
<div id="container_left" style="color:#FFF; float:left; width:50%;">
function(file) {
openFile(file);
});
</div>
<div id="container_right" style="color:#FFF; float:right; width:50%";></div>
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you. I'd never come across http://jsfiddle.net either so that was a bonus! :)
ASKER
Firstly thank you. That's was what I was after but I'm having trouble implementing it.
I'm using jQuery File Tree and I "need" to insert your code into the "function(file)" call. The "File" variable contains the path and filename.
This example opens the file in a new window.
Open in new window
Again any help would be greatly appreciated.
Thanks,