F
Frank
Hi,
I'm not familiar with JavaScript but have to fix a problem.
Please see below part of the HTML code with contains my question:
The problem is that I have to display a path in the showIt function.
If I write the path (C:\TEMP\396.x00) directly in the document.write()
function is shows the path without the backslashed.
So I though I create a fixPath function that replaces the single backslash
to a forward backslash (better a forward slash than no slash; but I would
like to see a backslash if possible)
The fixPath however doesn't replace the backslash with a forward slash?
Why not?
FYI: I can't change the input string as it is generated by another program
Please help me.
Frank
....
<script language="JavaScript" type="text/javascript">
<!--
function fixPath( s )
{
return s.replace(/\\/g, "/");
}
function showIt()
{
document.write(fixPath("C:\TEMP\396.x00")+"<br>");
}
....
I'm not familiar with JavaScript but have to fix a problem.
Please see below part of the HTML code with contains my question:
The problem is that I have to display a path in the showIt function.
If I write the path (C:\TEMP\396.x00) directly in the document.write()
function is shows the path without the backslashed.
So I though I create a fixPath function that replaces the single backslash
to a forward backslash (better a forward slash than no slash; but I would
like to see a backslash if possible)
The fixPath however doesn't replace the backslash with a forward slash?
Why not?
FYI: I can't change the input string as it is generated by another program
Please help me.
Frank
....
<script language="JavaScript" type="text/javascript">
<!--
function fixPath( s )
{
return s.replace(/\\/g, "/");
}
function showIt()
{
document.write(fixPath("C:\TEMP\396.x00")+"<br>");
}
....