vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Simple Java Code Problem (https://vborg.vbsupport.ru/showthread.php?t=210975)

MaR? 04-12-2009 03:40 AM

Simple Java Code Problem
 
This Java Code have this error:

Code:

else {document.write('<img src='XXXXXXXXXXXXXXXXXXXX/+seleccionado+' width='+width+' height='+height+'>');

It suppose to be:

Code:

else {document.write('<img src='XXXXXXXXXXXXXXXXXXXX/'+seleccionado+' width='+width+' height='+height+'>');
But I dont know where to make the change on the code:

Code:


<script type="text/javascript">;
<!--
width="900"; //Anchura del banner
height="140"; //Altura del banner
 
banners= new Array();
banners[0]="XXXXXXXXXX/images/misc/cabe0.jpg";
banners[1]="XXXXXXXXXX/images/misc/cabe1.jpg";
banners[2]="XXXXXXXXXX/images/misc/cabe2.jpg";
banners[3]="XXXXXXXXXX/images/misc/cabe3.jpg";
banners[4]="XXXXXXXXXX/images/misc/cabe4.jpg";
banners[5]="XXXXXXXXXX/images/misc/cabe5.jpg";
banners[6]="XXXXXXXXXX/images/misc/cabe6.jpg";
banners[7]="XXXXXXXXXX/images/misc/cabe7.jpg";
banners[8]="XXXXXXXXXX/images/misc/cabe8.jpg";
banners[9]="XXXXXXXXXX/images/misc/cabe9.jpg";
banners[10]="XXXXXXXXXX/images/misc/cabe10.jpg";
banners[11]="XXXXXXXXXX/images/misc/cabe11.jpg";
banners[12]="XXXXXXXXXX/images/misc/cabe12.jpg";
banners[13]="XXXXXXXXXX/images/misc/cabe13.jpg";
banners[15]="XXXXXXXXXX/images/misc/cabe14.jpg";
banners[14]="XXXXXXXXXX/images/misc/cabe16.jpg";
banners[16]="XXXXXXXXXX/images/misc/cabe17.jpg";
banners[17]="XXXXXXXXXX/images/misc/cabe18.jpg";
banners[18]="XXXXXXXXXX/images/misc/cabe19.jpg";
banners[19]="XXXXXXXXXX/images/misc/cabe20.jpg";
banners[20]="XXXXXXXXXX/images/misc/cabe21.jpg";
banners[21]="XXXXXXXXXX/images/misc/cabe22.jpg";
banners[22]="XXXXXXXXXX/images/misc/cabe23.jpg";
banners[23]="XXXXXXXXXX/images/misc/cabe24.jpg";
banners[24]="XXXXXXXXXX/images/misc/cabe25.jpg";
banners[25]="XXXXXXXXXX/images/misc/cabe26.jpg";
banners[26]="XXXXXXXXXX/images/misc/cabe27.jpg";
banners[27]="XXXXXXXXXX/images/misc/cabe28.jpg";
banners[28]="XXXXXXXXXX/images/misc/cabe29.jpg";
banners[29]="XXXXXXXXXX/images/misc/cabe30.jpg";
banners[30]="XXXXXXXXXX/images/misc/cabe31.jpg";
banners[31]="XXXXXXXXXX/images/misc/cabe32.jpg";
banners[32]="XXXXXXXXXX/images/misc/cabe33.jpg";
banners[33]="XXXXXXXXXX/images/misc/cabe34.jpg";
banners[34]="XXXXXXXXXX/images/misc/cabe35.jpg";
banners[35]="XXXXXXXXXX/images/misc/cabe36.jpg";
banners[36]="XXXXXXXXXX/images/misc/cabe37.jpg";
banners[37]="XXXXXXXXXX/images/misc/cabe38.jpg";
banners[38]="XXXXXXXXXX/images/misc/cabe39.jpg";
banners[39]="XXXXXXXXXX/images/misc/cabe40.jpg";
banners[40]="XXXXXXXXXX/images/misc/cabe41.jpg";
banners[41]="XXXXXXXXXX/images/misc/cabe42.jpg";
banners[42]="XXXXXXXXXX/images/misc/cabe43.jpg";
 
 
totalbanners = banners.length;
var ahora = new Date()
var segundos = ahora.getSeconds()
var ad = segundos % totalbanners;
seleccionado=banners[ad];
localizador=seleccionado.lastIndexOf('.');
localizador2=localizador+4
extension=seleccionado.substring(localizador+1,localizador2); 
archivo=seleccionado.substring(0,localizador);
 
document.write("<center>");
if (extension=="swf"){
flash=seleccionado;
document.write('<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=' + width + ' height=' + height + ' CODEBASE=\"xxxxxxxxxxxxxxx/flash4/cabs/swflash.cab#version=4,0,0,0\">');
document.write('<PARAM NAME=\"MOVIE\" VALUE=\"' + flash + '\">');
document.write('<PARAM NAME=\"PLAY\" VALUE=\"true\">');
document.write('<PARAM NAME=\"LOOP\" VALUE=\"true\">');
document.write('<PARAM NAME=\"QUALITY\" VALUE=\"high\">');
document.write('<EMBED SRC=' + flash + ' width=' + width + ' height=' + height + ' PLAY=\"true\" LOOP=\"true\" QUALITY=\"high\" PLUGINSPAGE=\"xxxxxxxxxxxxxxxxxxx/shockwave/download/index.cgi? P1_Prod_Version=ShockwaveFlash\">');
document.write('</EMBED>');
document.write('</OBJECT>');}
else {document.write('<img src='+seleccionado+' width='+width+' height='+height+'>');
document.write('</center>');}
// -->;
</script>

I hope you can helpme!


Thanks

Dismounted 04-12-2009 04:08 AM

Looks a lot like this line, doesn't it? ;)
Code:

else {document.write('<img src='+seleccionado+' width='+width+' height='+height+'>');

MaR? 04-12-2009 04:24 AM

Totally!!!... but... donĀ“t you see the code line seems to be right... but after all I, having this error...

Im not a magic girl... I swear

I fell so stupid... I found this code on the internet... but Vbseo make the logos dissapear.... and they tellme there is the problem... but I cant fix It....

Lynne 04-12-2009 03:41 PM

It's these lines which adds the image path to the word:

Code:

seleccionado=banners[ad];
localizador=seleccionado.lastIndexOf('.');
localizador2=localizador+4

I don't do javascript (java is very different from javascript which is what this is), so I'm not sure exactly what you should do. Play with it on your test site until it is right. (Is that last line missing a ; at the end?)


All times are GMT. The time now is 12:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01047 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete