Resulta que me pasaron un codigo que tengo que insertar en una pagina de un cliente y el mismo no funciona da error, creo que el error es de corcheas en los if y la aplicacion vbulletin no me deja ponerlo por esa razon...
Pueden probar el codigo en esta pagina para ver el error:
http://www.javascriptlint.com/online_lint.php
Y el Codigo que deben insertar para ver el error es este:
Código:
El error que veo es el siguiente:<script> if (typeof(__cpa_setup) == 'undefined') var __cpa_setup = {398:{}}; if (typeof(__cpa_setup[398]) == 'undefined') __cpa_setup[398] = {}; __cpa_setup[398][0] = { param: { 's': '', 'r': 'pagina.com', 'f': '', 'cs': typeof(document.characterSet) == 'undefined' ? document.defaultCharset : document.characterSet, 'u': '' }, text: { mediagetCaption10: "Descargar Gratis: ", mediagetCaption11: "Gratis", mediagetDownload1: "Descargar Gratis", mediagetDesc1: "Descarga Gratis con MediaGet", mediaCaption1: "Descargar Gratis: ", mediaCaption2: "Gratis", mediaDownload1: "Descargar Gratis", mediaDesc1: "Descarga Gratis con MediaGet" } }; __cpa_setup[398][0]['param']['s'] = document.title; __cpa_setup[398][0]['param']['f'] = __cpa_setup[398][0]['param']['s']; </script> <div align="center"> <div id="cpa_rotator_block_398_0"> <div style="width:468px;height:60px;overflow:hidden; background:#f2f4bd; border-left:1px solid #d4d4d4;overflow:hidden;"> <h2 style="text-align:center;margin:10px 1px 0 10px;padding:0;color:#000;font-family: arial;font-size: 16px;cursor:default; overflow:hidden;"><span id="mediagetCaption10398_0"></span><span id="mediagetFile1398_0">__rotator_param_f</span><span id="mediagetCaption11398_0"></span></h2> <a id="mediagetLink1398_0" href="" style="text-decoration: underline; display:block; margin:6px 10px 0 0; font-size: 16px; background:#f2f4bd;width:121px;height:30px;text-align: center;color:#000;font-weight: bold;font-family: arial; cursor:pointer"><font id="mediagetDownload1398_0"></font></a> <p id="mediagetDesc1398_0" style="text-align:center;margin:5px 2px 0 2px; padding:0;color:#000;font-family: arial;font-size: 11px;cursor:default;"></p> <div style="clear:both;"></div> </div> <script type="text/javascript"> key = '398_0'; try { setup = __cpa_setup[398][0]; for ( name in setup['text'] ) { document.getElementById(name + key).innerHTML = setup['text'][name]; } s = setup['param'].s; f = setup['param'].f; cs = setup['param'].cs; r = setup['param'].r; document.getElementById('mediagetFile1' + key).innerHTML = f; document.getElementById('mediagetLink1' + key).href = "http://mediaget.com/torrent.php?r="+r+"&s="+s+"&f="+f+"&cs="+cs; } catch (e) {} try { text_button = document.getElementById('mediagetFile1' + key).innerHTML.replace(/\s+/g, ' '); text_caption1 = document.getElementById('mediagetCaption10' + key).innerHTML; text_caption2 = document.getElementById('mediagetCaption11' + key).innerHTML; caption_max = 51; caption_length = text_button.length + text_caption1.length + text_caption2.length; optimal_length = caption_max - text_caption1.length - text_caption2.length; if (optimal_length < 10) optimal_length = 10; if ( caption_length > caption_max ){ document.getElementById('mediagetFile1' + key).innerHTML = text_button.substring(0, optimal_length - 3).replace(/\s*$/, '') + "..."; } } catch (e) {} </script> </div> <script type="text/javascript" src="http://bubblesmedia.ru/invoke.php?id=398&subid=0"></script> </div>
1 <script>
2 if (typeof(__cpa_setup) == 'undefined') var __cpa_setup = {398:{}};
========================================^
lint warning: block statement without curly braces
3 if (typeof(__cpa_setup[398]) == 'undefined') __cpa_setup[398] = {};
=============================================^
lint warning: block statement without curly braces
55 if (optimal_length < 10) optimal_length = 10;
=========================^
lint warning: block statement without curly braces
Pueden darme una ayuda con esas lineas ?
Gracias desde ya :)