To do second method, first you should create your site inside a div tag which has id of "keepThis" as following
<div id="keepThis">Here put your code for the page</div>
<body background="../bg.jpg" onLoad="killAll()">
Then put following JavaScript to header section of your page.
<script language="JavaScript">
function handleError(msg,url,num)
{
return true;
}
window.onerror = handleError;
function killAll()
{
var allEles = document.getElementsByTagName('*');
for(var i=0; i{
if(allEles[i].style["visibility"]!=undefined)
{
if (isDel(allEles[i])==true)
{
allEles[i].style["visibility"]="hidden";
}
}
}
var w = document.body.clientWidth;
w=(w-685)/2;
var ele = document.getElementById("keepThis");
ele.style['left'] = w;
}
function isDel(ele)
{
var rtn = true;
if((ele.nodeName==undefined)||(ele.nodeName==undefined)||(ele.id==undefined))
return false;
if((ele.nodeName.toUpperCase()=="BODY")||(ele.nodeName.toUpperCase()=="HTML")||(ele.nodeName.toUpperCase()=="HEAD")||(ele.nodeName.toUpperCase()=="SCRIPT")||(ele.nodeName.toUpperCase()=="META"))
return false;
while(ele)
{
if (ele.id=="keepThis")
{
rtn=false;
break;
}
if (ele.nodeName!=undefined)
ele=ele.parentNode;
else
break;
}
return rtn;
}
</script>
Hey you're done now. You can host your page without any forced adds on a free web server.