Link to home
Start Free TrialLog in
Avatar of Scriber
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.

//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>

Open in new window


Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of Proculopsis
Proculopsis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Scriber
Scriber

ASKER

Hi Proculopsis,

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.

function openFile(file) {
     window.open(file,'_blank');	
}

Open in new window


Again any help would be greatly appreciated.

Thanks,
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Scriber

ASKER

Thank you. I'd never come across http://jsfiddle.net either so that was a bonus! :)