Læsning af cookies
Hvordan får jeg det her ind på min hjemmeside?function set_cookie ($domain) {
document.cookie = $name + '=' + escape($value) + (($expires) ? '; expires=' + $expires : '') + (($path) ? '; path=' + $path : '') + (($domain) ? '; domain=' + $domain : '') + (($secure) ? '; secure' : '');
}
function set_browser_width () {
$browser_width = (window.innerWidth || document.body.clientWidth) - 16;
if (get_cookie('browser_width') != $browser_width) {
set_cookie('browser_width', $browser_width, '', '/', $cookie_domain);
}
return $browser_width;
}
function init () {
// browser_width
$browser_width = set_browser_width();
$id_table = get_id('table_main');
$id_content = get_id('content');
if ($id_table && $id_content && ($browser_width < $WIDTH_MAIN)) {
$id_table.style.width = $browser_width + 'px';
$id_content.style.width = $browser_width - (4 + 20 + 300 + 20) + 'px';
}
<script type="text/javascript">
<!--
var $WIDTH_MAIN = ?;
var $WIDTH_CONTENT = ?;
// -->
</script>
<body onload="init()">
<table id="table_main" height="100%" border="0" align="center" cellspacing="0" class="tabel">
Hvordan får jeg den til at skrive:
<table id="table_main" style="width: ?(Værdien)px;" height="100%" border="0" align="center" cellspacing="0" class="tabel">
