Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying text from a document in a slide show

Status
Not open for further replies.

gns100

Programmer
Aug 11, 2003
40
US
I'm trying to transfer the text in a document which is in a function to the <body> section of the code to be displayed in a slide show. I was able to transfer a string but I want to replace the string with a number of text files (e.g. myText_1.txt to go with the first slide etc.). The code below displays the document location and not the document itself.

The relevant part is near the bottom of the code.

Anyone out there have any ideas? I think it should be straightforward but so far have had no success.

Thanks

Code:
<html>

<head>
<title>none</title>

<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!-- Hide from browsers that do not support JavaScript

var timerId = setInterval(&quot;timedPhoto()&quot;, 2*1000)
last = 4

var viewRandom = 0
var viewCycle = 10
var photoNum = 0

// -->
</script>

</head>

<body bgcolor=&quot;#FF9900&quot;>

<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot; bordercolor=&quot;#111111&quot; width=&quot;579&quot; height=&quot;158&quot;>
  <tr>
    <td width=&quot;373&quot; height=&quot;60&quot; bgcolor=&quot;#FFFF99&quot;>
    <p style=&quot;margin-left: 9; margin-right: 9&quot; align=&quot;center&quot;><br>
    <b><font face=&quot;Arial&quot; size=&quot;5&quot; color=&quot;#0000FF&quot;>Local</font></b></p>
    <p style=&quot;margin-left: 9; margin-right: 9&quot;>
    <font lang=&quot;0&quot; face=&quot;Arial&quot; size=&quot;2&quot; FAMILY=&quot;SANSSERIF&quot;> </font></p>
    <p style=&quot;margin-left: 9; margin-right: 9&quot;>
     </p>
    <p style=&quot;margin-left: 9; margin-right: 9&quot;>
     </p>
    <p style=&quot;margin-left: 9; margin-right: 9&quot;>
     </p>
    <p style=&quot;margin-left: 9; margin-right: 9&quot;>
    <font face=&quot;Arial&quot; size=&quot;2&quot;>See one of their recent projects in the adjacent 
    photo display.</font></p>
    <p style=&quot;margin-left: 9; margin-right: 9&quot; align=&quot;center&quot;> </td>
    <td width=&quot;195&quot; height=&quot;158&quot; bgcolor=&quot;#FFCC66&quot; rowspan=&quot;2&quot;>
    <table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot; bordercolor=&quot;#111111&quot; width=&quot;88%&quot; height=&quot;186&quot;>
      <tr>
        <td width=&quot;100%&quot; height=&quot;128&quot;>
        <p align=&quot;center&quot;>
        <img border=&quot;2&quot; src=&quot;file:///j:/myImage_1.jpg&quot; name=&quot;showPhotoRotate&quot; align=&quot;center&quot;></td>
</td>
      </tr>
      <tr>
        <td width=&quot;100%&quot; height=&quot;37&quot;><p align=&quot;center&quot;><b><font face=&quot;Arial&quot; size=&quot;3&quot;> <span id = &quot;slideText&quot;></span></font></b></td>
      </tr>
      <tr>
        <td width=&quot;100%&quot; height=&quot;21&quot;><p align=&quot;center&quot;><b><font face=&quot;Arial&quot; size=&quot;2&quot;><span id = &quot;ministryText&quot;></span></font></b></td>
      </tr>
    </table>
    </td>
  </tr>
  <tr>
    <td width=&quot;373&quot; height=&quot;70&quot; bgcolor=&quot;#FFFF99&quot;>
    <p style=&quot;margin-left: 9; margin-right: 9&quot;> </td>
  </tr>
</table>

</body>
<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
<!-- Hide from browsers that do not support JavaScript
			
function timedPhoto() {
	//alert(&quot;last = &quot; + last)
	if (viewRandom == 1) {
	do {
		random1Photo = (Math.floor(Math.random() * 10) +1)
		//alert(&quot;random1Photo Number =&quot; + random1Photo)
		}
	while(last == random1Photo)
		
	last = random1Photo;
	}
	else {
		//alert(&quot;photoNum = &quot; + photoNum); 
		photoNum++;
		if(photoNum == viewCycle){
			photoNum = 1;
		}
		//alert(&quot;photoNum = &quot; + photoNum); 
		random1Photo = photoNum;
		imgNumber=random1Photo;
	}
	//}
	
			document.showPhotoRotate.src = &quot;file:///j:/myImages/image_mod_&quot; + imgNumber + &quot;.jpg&quot;

//THIS IS THE PART THAT DOESN'T WORK
			imageText_3 = &quot;file:///j:/myText_1.txt&quot;
			document.photoText=imageText_3
			document.getElementById(&quot;slideText&quot;).innerHTML = document.photoText

// THE PART BELOW WORKS			
			document.partnerText=&quot;Test2&quot;
			document.getElementById(&quot;ministryText&quot;).innerHTML = document.partnerText
}

//-->
</script>

</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top