Forum Discussion

rmnrdi's avatar
rmnrdi
Contributor
6 years ago

Fixing javascript path issues

I have a function that gets a path from the registry.   It is in the form C:\folder\folder\folder\   Unfortunately, this won't work in my javascript functions. It needs to be of the form C:...
  • tristaanogre's avatar
    6 years ago

     

    ACtually, it depends upon how you use it.  True, in JavaScript, if you want to hardcode a string to have the \ character, you need to double it.  But that isn't necessarily the case if you are reading text out of another location.  For example, Project.Path returns the location of the project file as a string.  This includes \ characters.  But I can use Project.Path in a filepath parameter without having to do any replacement.

     

    Can you share the code that you're attempting to use the registry path from? It would be good to see how you're trying to use it... perhaps there's a better way that wouldn't have that problem.