Javascript not working

  • 1
  • Question
  • Updated 8 years ago
  • Answered
Javascript not working

Here is the code :
Photo of Wahyu Kurniawan

Wahyu Kurniawan

  • 8 Posts
  • 0 Reply Likes
  • thankful

Posted 8 years ago

  • 1
Photo of Wahyu Kurniawan

Wahyu Kurniawan

  • 8 Posts
  • 0 Reply Likes
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Wahyu

If you're trying to paste code into the forum, please try using this encoder: http://forsite.synthasite.com/encoder.... Copy the encoded code and paste into the forum.

Then we can try to help you with this. If you could also share with us your site URL and the page where you're trying to implement the code, we could take a closer look there as well.
Photo of Wahyu Kurniawan

Wahyu Kurniawan

  • 8 Posts
  • 0 Reply Likes
Thanks Sanja
Here is my JS code

<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function setCaption(index)
{
var textArray = new Array();
textArray[1] = '';
textArray[2] = 'Halte Busway';
textArray[3] = 'Pramuka';
textArray[4] = '';
textArray[5] = '';
textArray[6] = '';
textArray[7] = '';
textArray[8] = '';
textArray[9] = '';
textArray[10] = '';
textArray[11] = '';
textArray[12] = '';
textArray[13] = '';
textArray[14] = '';
textArray[15] = '';
textArray[16] = '';

photo_caption.innerHTML = textArray[index];
}
//-->
Photo of Wahyu Kurniawan

Wahyu Kurniawan

  • 8 Posts
  • 0 Reply Likes
my photo caption is doesn't work,....
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Wahyu

Can you please let me know where you go this code from? I'd like to try and set this up on my site and see if I can make this work. Then, I can give you instructions on how to get this implemented on your site.
Photo of Wahyu Kurniawan

Wahyu Kurniawan

  • 8 Posts
  • 0 Reply Likes
that is the JS code for my photo caption on wahyukurniawan.yolasite.com/single. i'll try to put the dynamic photo caption, but it doesn't work,....
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Sorry Wahyu.. perhaps I'm not being clear. What is the original source of this the javascript code you're using to try and implement on your site? Would you be able to give me the name of the website of where you retrieved the code from in the first place?
Photo of Wahyu Kurniawan

Wahyu Kurniawan

  • 8 Posts
  • 0 Reply Likes
The JS code i take it from http://www.ronyzakaria.com/photos/fea...
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hi Wahyu

I took a look at the site. I was under the impression that the site would be a public resources site where they provide codes. Instead, this appears to be a personal site. I am unable to help with this.

However, I can suggest that you try using perhaps a code from http://dynamicdrive.com. The one that I was thinking of in particular that may be suitable for you is the Ultimate Fade-in Slideshow which can be found here: http://www.dynamicdrive.com/dynamicin....

I hope that you will be able to find something that works for you. If you need further help with any public codes, I'd be happy to assist.
Photo of Wahyu Kurniawan

Wahyu Kurniawan

  • 8 Posts
  • 0 Reply Likes
thanks Sanja
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
you're welcome. Please do let me know if you have any further questions.