Re a slideshow there is a downloadable demo (with code) having several options at:
I have a question relating to the code from this site. (See end for code) It uses a form & part of the output displays the URL of the image/picture. I wish to truncate the first 18 characters of the URL (directory portion etc) and the last four, the extension (.jpg etc). The **** line illustrates this. The ++++ line is meant to obtain the length of the URL, less 4.
Removing the -4 gives output deleting the first 18 chars, but leaves on the extension. How do I get the appropriate value?
function showAd() {
var srcobject;
var lengthstr = eval(document.slide.tit.length)-4; //++++
document.slide.tit.value=adImages[thisAd].substring(18,lengthstr); //****
document.adBanner.src = adImages[thisAd];
. . . and in the 'body' part is a line
<input name="tit" type="text" size="30" readonly="readonly">
referring to a TextField for the title "tit"
Any help would be most appreciated.
David
I have a question relating to the code from this site. (See end for code) It uses a form & part of the output displays the URL of the image/picture. I wish to truncate the first 18 characters of the URL (directory portion etc) and the last four, the extension (.jpg etc). The **** line illustrates this. The ++++ line is meant to obtain the length of the URL, less 4.
Removing the -4 gives output deleting the first 18 chars, but leaves on the extension. How do I get the appropriate value?
function showAd() {
var srcobject;
var lengthstr = eval(document.slide.tit.length)-4; //++++
document.slide.tit.value=adImages[thisAd].substring(18,lengthstr); //****
document.adBanner.src = adImages[thisAd];
. . . and in the 'body' part is a line
<input name="tit" type="text" size="30" readonly="readonly">
referring to a TextField for the title "tit"
Any help would be most appreciated.
David