SamirDarji
01-29-2006, 04:02 AM
I'm using the following function to modify tags used for mouseover text:function delHoverX()
{
re = /(\bdsc00001\b)/i;
imgTags = document.getElementsByTagName("img");
for (i=0; i<imgTags.length; i++)
{
if (re.test(imgTags[i].title))
{
origTitle = imgTags[i].title;
origAlt = imgTags[i].alt;
imgTags[i].title.replace(re, "$1");
imgTags[i].alt.replace(re, "$1");
if (origTitle == imgTags[i].title && origAlt == imgTags[i].alt)
{
imgTags[i].title = "same";
imgTags[i].alt = "same";
}
}
else
{
imgTags[i].title = "";
imgTags[i].alt = "";
}
}
}It is being used on the following web page: http://huntsvillecarscene.smugmug.com/gallery/1144571
For some reason, the regexp.replace is not working. There is a test clause in there to help me diagnose some of what's going on.
I'm not a Javascript programmer. I only have a limited background in C. I've been working on this for 2 days and am frustrated out of my mind.
Any assistance appreciated.
{
re = /(\bdsc00001\b)/i;
imgTags = document.getElementsByTagName("img");
for (i=0; i<imgTags.length; i++)
{
if (re.test(imgTags[i].title))
{
origTitle = imgTags[i].title;
origAlt = imgTags[i].alt;
imgTags[i].title.replace(re, "$1");
imgTags[i].alt.replace(re, "$1");
if (origTitle == imgTags[i].title && origAlt == imgTags[i].alt)
{
imgTags[i].title = "same";
imgTags[i].alt = "same";
}
}
else
{
imgTags[i].title = "";
imgTags[i].alt = "";
}
}
}It is being used on the following web page: http://huntsvillecarscene.smugmug.com/gallery/1144571
For some reason, the regexp.replace is not working. There is a test clause in there to help me diagnose some of what's going on.
I'm not a Javascript programmer. I only have a limited background in C. I've been working on this for 2 days and am frustrated out of my mind.
Any assistance appreciated.