Not logged in. · Lost password · Register
Forum: General discussion RSS
slashes in #RootDirectory
Bill (Guest) #1
No profile available.
Link to this post
I am trying to make a javascript function that changes the browser window back to the root directory, but when I do something like this:

window.frames["contentframe"].location="browser.html?dir=<#RootDirectory>";

It loses the slashes in the root directory name because the backslash is JavaScript's escape character.

What I could really use is something like #browser_enc_directoryname for RootDirectory so it would come encrypted.

I tried to write a Javascript function that would accomplish this but when I send the RootDirectory string to the function I must send it as a string so the slashes are already gone. 

Thanks for any ideas.
Bill (Guest) #2
No profile available.
Link to this post
I found a work around for this.

I put the RootDirectory into a form like this:

<form name="rootForm"><input type="hidden" name="root" value="<#RootDirectory>"></form>

Then onLoad() I load it into a variable:

var rootDir ="";
function setRootDir() {
    rootDir = document.rootForm.root.value;
}

and then I use the Javascript escape() function:

window.frames["contentframe"].location="browser.html?dir=" + escape(rootDir);
Avatar
Henry (Administrator) #3
Member since Jan 2003 · 865 posts · Location: Munich Germany
Group memberships: Administrators, Members
Show profile · Link to this post
BrowseAmp already supports escaping the tags. The syntax is like: <#RootDirectory escape=true>
See BrowseAmp help for more details and other encoding parameters.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Page created in 133.6 ms (49.1 ms) · 41 database queries in 44.3 ms
Current time: 2018-08-16, 21:50:57 (UTC +00:00)