Save item
Posted: Sun Mar 04, 2007 9:11 pm
Well i whant to save a items when i click on the link so next time i visit it should be there.
example
from the index.php
<li><a href="#" onclick="createRadio();">Radio</a></li>
<li><a href="#" onclick="createYoutube();">Youtube</a></li>
And from dragable-boxes.js
function createRadio()
{
var htmlContentOfNewBox = '<center><embed src="radio.php" width="150" height="150" wmode="transparent" type="application/x-shockwave-flash"></center>'; // HTML content of new box
var titleOfNewBox = 'Radio';
if(!staticObjectArray['staticObject3']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(2,false,false,'staticObject3');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject3']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject3']).innerHTML = titleOfNewBox;
}
}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject3']);
function createYoutube()
{
var htmlContentOfNewBox = '<center><iframe src="youtube.php" name="iframe" width="230" marginwidth="10" height="100" marginheight="10" scrolling="auto"></iframe></center>'; // HTML content of new box
var titleOfNewBox = 'YouTube';
if(!staticObjectArray['staticObject4']){ // The box is not stored in cookie - we need to create it.
var newIndex = createABox(2,false,false,'staticObject4');
document.getElementById('dragableBoxContent' + newIndex).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + newIndex).innerHTML = titleOfNewBox;
}else{ // Box is stored in cookie - all we have to do is to move content into it.
document.getElementById('dragableBoxContent' + staticObjectArray['staticObject4']).innerHTML = htmlContentOfNewBox;
document.getElementById('dragableBoxHeader_txt' + staticObjectArray['staticObject4']).innerHTML = titleOfNewBox;
}
}
hideHeaderOptionsForStaticBoxes(staticObjectArray['staticObject4']);