ultimamente ho scritto una funzioncina che che mi velocizza la creazione di un elemento, il settaggio degli attributi e l' append al padre, in un colpo solo
a brevissimo termine la pubblico e approfondisco certe cose che si possono fare con essa
nel frattempo, se vuoi dai un' occhiata a come puo' essere applicata al tuo caso specifico
puoi prenderla da qui e testarla con il seguente codice
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="function_create.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
function $(id){
return document.getElementById(id);
}
function createSwf(link){
if($('swfObject')){$('swfHolder').removeChild($('swfObject'))}
var path=link.href;
if(!document.all || window.opera)
create('<object>',{'id':'swfObject','type':'application/x-shockwave-flash','data':path,'width':'425','height':'355'},[
create('<param>',{'name':'movie','value':path}),
create('<param>',{'name':'wmode','value':'transparent'})
],$('swfHolder'));
else create('<embed>',{'id':'swfObject','width':'425','height':'355','type':'application/x-shockwave-flash','src':path,'wmode':'transparent'},'',$('swfHolder'));
return false
}
/*]]>*/
</script>
</head>
<body>
<ul>
[*]underworld - beautiful burnouts
[*]ellen allien and apparat - way out (unofficial)[/list]
<div id="swfHolder">
</div>
</body>
</html>