Path with backslashes to path with forward slashes javascript

前端 未结 1 1902
长发绾君心
长发绾君心 2021-01-11 11:03

I\'m trying to make a local xml file parsing \"application\" for some colleagues and i\'m using the current function to retrieve the files:

         


        
相关标签:
1条回答
  • 2021-01-11 11:35

    The replace method does not alter the current instance of the string, but returns a new one. See if this works:

    pathString = pathString.replace(/\\/g,"/");
    

    See this example on jsfiddle.

    0 讨论(0)
提交回复
热议问题