Click to See Complete Forum and Search --> : Script not working in netscape


gail
08-02-2005, 02:14 PM
I am running a graphic name generator on my site, and I am
getting emails that it's not working for people with netscape.
I'm not even sure if it's working on anything outside IE, as
that's all I use.
I have diabled it until the problem can be fixed, if there is
in fact even a problem? Am I missing something?
Javascript is all new, and like a foreign language to me,
so I was hoping someone here could please help.

function imageActions(char, format, rep)
{
var imgArray = new Array();
imgArray = document.images;

var imgName = char+"."+format;

document.getElementById("divTag").innerHTML += "<img src='' name='imageArea'>";

imgArray[rep+1].src = imgName;
}

function checkAndDisplay()
{

if (document.images.length >= 0)
{
document.getElementById("divTag").innerHTML = "";
}

var textbox = window.document.form1.textbox1.value;

for (var index = 0; index < textbox.length; index++)
{
var the_char = textbox.charAt(index);

if (the_char == ' ')
{
the_char = "space";
imageActions(the_char, 'gif', index);
}
else if (the_char == '.')
{
the_char = "period";
imageActions(the_char, 'gif', index);
}
else
{
imageActions(the_char, 'gif', index);
}
} // end of for loop
} // end of checkAndDisplay() function

function clearText()
{
window.document.form1.textbox1.value = '';
}
function convertLowercase()
{
window.document.form1.textbox1.value = window.document.form1.textbox1.value.toLowerCase();
}

How the name generator works is.....
A person will type in their name, and each letter of their
name produces a .gif image....in my case, an animated
alphabet for each letter they type in.

I hope all of this makes sense?

Thank you in advance for your help.

Kravvitz
08-02-2005, 03:20 PM
Which versions of Netscape are they using?

Try this.
function imageActions(char, format, rep)
{
document.getElementById("divTag").innerHTML += "<img src='"+char+"."+format+"' name='imageArea'>";
}

gail
08-02-2005, 04:16 PM
They did not indicate which version of netscape they were
using, and since this thread was started today, I received
yet another email from a visitor, that it was not working in
their mozilla browser.

I will give your code a try, but forgive me if I have to ask
where within the script should your code be inserted?

Thank you for your help.

Kravvitz
08-02-2005, 05:08 PM
Make a backup of your code and then replace your imageActions() function with my imageActions() function.