- This topic is empty.
- AuthorPosts
-
- 04/27/2015 at 4:08 am #4621
AnonymousParticipantHi!
Can anyone share their knowledge with me, regarding an error message that I received from a JavaScript that was developed in Notepad. The error message that I receive and the JavaScript that I developed are as follows:
Error Message:
Script: C:\Users\robertsd\Desktop\Conditional Severity.js
Line: 1
Char: 1
Error: Syntax Error
Code: 800A03EA
Source: Microsoft JScript compliation error
Developed JavaScript:
<script type=”text/JavaScript”>function DisplaySeverity(severity){ var imgSrc = ‘ ‘;
if (severity == ‘(1) OVERDUE’) { imgSrc = ‘teamspace.merck.com/…/Overdue.png‘; } else if (severity == ‘(2) Alert’) { imgSrc = ‘teamspace.merck.com/…/Alert.png‘; } else if (severity == ‘(3) ON TIME’) { imgSrc = ‘teamspace.merck.com/…/On%20Time.png‘; } else if (severity == ‘(4) Completed On Time’) { imgSrc = ‘teamspace.merck.com/…/Completed%20On%20Time.png’; } return ‘<img alt=”’ + severity + ‘” src=’” + imgSrc + ‘”>’; }</script>
Thanks in advance for your response.
- 04/27/2015 at 4:08 am #7422
AnonymousParticipantHi ,
At the first sight for the script, I noticed that some single quotes and the double quotation marks are wrong in the script, I am not sure whether it is the editor issue. I have modify it, you could take a try.
<script type="text/JavaScript">
function DisplaySeverity(severity)
{
var imgSrc = ' ';
if (severity == '(1) OVERDUE')
{
imgSrc = 'teamspace.merck.com/…/Overdue.png';
}
else if (severity == '(2) Alert')
{
imgSrc = 'teamspace.merck.com/…/Alert.png';
}
else if (severity == '(3) ON TIME')
{
imgSrc = 'teamspace.merck.com/…/On%20Time.png';
}
else if (severity == '(4) Completed On Time')
{
imgSrc = 'teamspace.merck.com/…/Completed%20On%20Time.png&rsquo';
}
return '<img alt="' + severity + '" src="' + imgSrc + '">';
}
</script>
-
- AuthorPosts
You must be logged in to reply to this topic. Click here to Login