urgent ... need javascript help .....deadline tonight

  • mut101
  • Newbie
  • Newbie
  • mut101
  • Posts: 6

Post 3+ Months Ago

Ok
I am new to javascript but I know php alright. I took on a project that the guy has a javascript slideshow for his longhorn cattle and wanted to put the pedigrees under all the pics. So i made a external javascript that loads into the existing javascript with arrays and thought that i could just put the pedigrees in those arrays that was working fine untill I talked to him again and found out that he wanted it to look like the pdf files that he was sending me. That was 98 pdf files that i would have to write out in each array. So instead of writting out all those arrays I used a pdf to html converter. So to make a long storie short what I want to do is make the urls of the html files arrays, and load them in as the slide show pictures do. But I can not figgure out how to make it load a html file as the pictures already do. This is the code that loades in the pics and names

document.write("<script src='functions.JS'><\/script>");


function initSlideShow() // initialize the slideshow
{
makeSlideShow(); // populate g_slidesArray[] with slide objects
makePed_1(); //populate g_pedArray[] with slide objects
// display first slide title and slide URL in slideFrame frame
g_HTMLstring = "<H1>" + g_slidesArray[g_currSlideIndex].title + "</H1>";
g_HTMLstring += "<TABLE BORDER='5'><TR><TD>";
g_HTMLstring += "<IMG SRC='" + g_slidesArray[g_currSlideIndex].URL +"' ";
g_HTMLstring += "NAME='slideImage'></TD></TR></TABLE><br> <TABLE BORDER='0'><TR><TD><h1>" + g_pedArray[g_currPedIndex].ped + "</h1></TD></TR> </table>";
top.slideFrame.location.href = "slide.htm";

// display first slide text in textFrame frame
top.textFrame.location.href = "text.htm";
}

The last part is what i am needing to change to make it work but i do not know what to use. This is what I was kind of thinking but i am pretty clueless at this point

top.slideFrame.location.href = g_pedArray[slideIndex].ped

that does not work but is a idea, the .ped is the arrays from the functions.JS. I need to know how to load the html files as the pics do. I am sure it is really simple but I dont know were to go with it.
Any ideas would be greatly apreciated.
Thank you
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • mut101
  • Newbie
  • Newbie
  • mut101
  • Posts: 6

Post 3+ Months Ago

Does know how to make it so i can just make the array a varible to replace the "text.html"? That is all I really need to know it should not be to hard im sure there are a few smart people that can answer this.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Posts: 4581
  • Loc: Maryland

Post 3+ Months Ago

how so, just one item from the array or the whole array?
  • mut101
  • Newbie
  • Newbie
  • mut101
  • Posts: 6

Post 3+ Months Ago

I have made a bunch of arrays with the html pages in them,
this a short list of my function of arrays.

function makePed_2() //this will be the functions for the pedigree for slide show 1
{
g_pedArray[0] = new ped ("/pdf/EOT%20CLASSY%20GLIMMER/classyglimmer1.html");
g_pedArray[1] = new ped ("/pdf/EOT%20CLASSY%20GLIMMER/classyglimmer2.html");
g_pedArray[2] = new ped (" /pdf/EOT%20CLASSY%20GLIMMER/classyglimmer3.html");}
  • RichB
  • Guru
  • Guru
  • User avatar
  • Posts: 1121
  • Loc: Boston

Post 3+ Months Ago

Rather than making an array of ped object for the url, perhaps you could just make a simple array of strings:
Code: [ Select ]
function makePDFArray()
{
    pdf[0] = "pdf/classyglimmer1.html";
    pdf[1] = "pdf/classyglimmer2.html";
    pdf[2] = "pdf/classyglimmer3.html";
}
  1. function makePDFArray()
  2. {
  3.     pdf[0] = "pdf/classyglimmer1.html";
  4.     pdf[1] = "pdf/classyglimmer2.html";
  5.     pdf[2] = "pdf/classyglimmer3.html";
  6. }

and then do something like:

Code: [ Select ]
top.textFrame.location.href = pdf[theIndex];


or if the numbers on the end of the glimmer files match the slide index maybe you could just do something like:
Code: [ Select ]
basePath = "pdf/classyglimmer";
top.textFrame.location.href = basePath + g_currSlideIndex + ".html";
  1. basePath = "pdf/classyglimmer";
  2. top.textFrame.location.href = basePath + g_currSlideIndex + ".html";

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 112 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.