Hi,
I have a Java Server Pages (JSP) script running, in which I want to call a Javascript function. Firstly is this possible and secondly how do I do it? Here is an extract of the code I'm running, at the moment the else condition simply prints out "javascript:wrongFileType()" to the screen as opposed to the alert box I'm looking for:
function wrongFileType()
{
alert('\n Wrong file type!!!!!! ');
}
if (some condition......)
{
Do something //Actual code works correctly
}
else
{
out.println("javascript:wrongFileType()");
//Prints the literal value "javascript:wrongFileType()" as opposed to the alert message I want
}
I have a Java Server Pages (JSP) script running, in which I want to call a Javascript function. Firstly is this possible and secondly how do I do it? Here is an extract of the code I'm running, at the moment the else condition simply prints out "javascript:wrongFileType()" to the screen as opposed to the alert box I'm looking for:
function wrongFileType()
{
alert('\n Wrong file type!!!!!! ');
}
if (some condition......)
{
Do something //Actual code works correctly
}
else
{
out.println("javascript:wrongFileType()");
//Prints the literal value "javascript:wrongFileType()" as opposed to the alert message I want
}