Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disappearing '\'.....

Status
Not open for further replies.

KeyserSoze1877

Programmer
Sep 6, 2001
95
US
I have a javascript function that spawns a new formatted window that plays recorded phone calls.

----------------------------------------------
Heres my script:
<script><!--
function OpenDDpage(page) {
DDflyout=window.open(page, 'LinkedPoint',
config='left=600,top=0,width=400,height=400,scrollbars=yes,
resizable=yes,status=no,toolbar=no');
}
// -->
</script>

Heres my call:
javascript:OpenDDpage('test.cfm?file=\\v01\v01D\!TestDir\Dir\filename.wav')
-----------------------------------------------
Doing this the file variable changes to
\v01v01D!TestDirDirfilename.tmp in the test.cfm page.

Why does it parse out the single '\'?

The directories I need to post come from a table, how do I pass the directory without losing the '\' and without using chr() commands everywhere?

Mr. K
 
I believe that in javascript.. \ comments the next character.. this is used for quotes and things.. try this...

<CFSET FileVariable=Replace(FileVariable,&quot;\&quot;,&quot;\\&quot;,&quot;ALL&quot;)>

Tony
 
The \ character is an modify/escape character in the javascript language. It's a little sporatic in the way that it works though. To fix your problem change your script to read javascript:OpenDDpage('test.cfm?file=\\\\v01\\v01D\\!TestDir\\Dir\\filename.wav') and it should work correctly. You should replace all of your \ with \\ because certain characters after the \ have special meanings. Below are some of the most common.

\n - new line
\r - return (no new line)
\t - tab

Hope this helps
RnK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top