javascript - another way of using (calling?) <body onload="init()"> -


i working on ebay listing in using js powered tabber.

i believe ebay automatically strips out tags such <body> <html> etc , in doing has stripped out <body onload="init()"> , bans use of ".cookie", "cookie(, "replace(".iframe, meta, or includes), cookies, or href."

unfortunately javascript (html , css) skills pretty poor appreciate if tell me rename <body onload="init()"> to, work?

here link how should - http://sweetvision.co.uk/ebayimages/camo/gilet.html

here listing looks - http://www.ebay.co.uk/itm/330879734834?var=&sspagename=strk:meselx:it&_trksid=p3984.m1555.l2649

here code:

    <script type="text/javascript"> var tablinks = new array(); var contentdivs = new array(); function init() { // grab tab links , content divs page var tablistitems = document.getelementbyid('tabs').childnodes; ( var = 0; < tablistitems.length; i++ ) { if ( tablistitems[i].nodename == "li" ) { var tablink = getfirstchildwithtagname( tablistitems[i], 'a' ); var id = gethash( tablink.getattribute('href') ); tablinks[id] = tablink; contentdivs[id] = document.getelementbyid( id ); } } // assign onclick events tab links, , // highlight first tab var = 0; ( var id in tablinks ) { tablinks[id].onclick = showtab; tablinks[id].onfocus = function() { this.blur() }; if ( == 0 ) tablinks[id].classname = 'selected'; i++; } // hide content divs except first var = 0; ( var id in contentdivs ) { if ( != 0 ) contentdivs[id].classname = 'tabcontent hide'; i++; } } function showtab() { var selectedid = gethash( this.getattribute('href') ); // highlight selected tab, , dim others. // show selected content div, , hide others. ( var id in contentdivs ) { if ( id == selectedid ) { tablinks[id].classname = 'selected'; contentdivs[id].classname = 'tabcontent'; } else { tablinks[id].classname = ''; contentdivs[id].classname = 'tabcontent hide'; } } // stop browser following link return false; } function getfirstchildwithtagname( element, tagname ) { ( var = 0; < element.childnodes.length; i++ ) { if ( element.childnodes[i].nodename == tagname ) return element.childnodes[i]; } } function gethash( url ) { var hashpos = url.lastindexof ( '#' ); return url.substring( hashpos + 1 ); } // </script>    <body onload="init()">  <div class="tabber"> <ul id="tabs">   <li><a href="#important" class="selected">important</a></li>   <li><a href="#delivery" class="">delivery</a></li>   <li><a href="#returns" class="">returns</a></li> </ul> 

thanks in advance help!


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -