Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7730223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:10:15+00:00 2026-06-01T06:10:15+00:00

I have an application which parses strings and passes them via jQuery to a

  • 0

I have an application which parses strings and passes them via jQuery to a popup window. Some of the strings I am passing contain a field for web addresses OR internal C: drive locations. When I pass the string to the window, the backslash (“\”) from the windows path is being stripped out (the web addresses using the forwardslash is, of course, no problem. I am trying to pass these strings as links, so the user can just click on the link and off they go. Obviously, if the backslashes are stripped, the link does not work. How the heck do I test for this? I have tried a few simple regexes that don’t work.

EDIT: The strings that I am parsing come from a Sharepoint list of applications, and I have no control over their format, they are simply entered into the list as “\drive\then\the\path\to\the\file”. My understanding is that I need to check to see if there is a backslash, then escape it by adding another backslash. But how?

EDIT 2: Good to know that I was on the right track. From what I had read on the internets, I had figured it was something along this line. However, I still can’t get this to work. Maybe you folks could help me out….

I have grabbed the field from the sharepoint list like this (sharepoint stores field names with a prefix of ‘ows_’:

var devPath = "<a class='h_link' href='"+$(this).attr('ows_DEVPathURLServer')+"'>"+$(this).attr('ows_DEVPathURLServer')+"</a>";

This works great for web URLs, as stated.

So then I messed around with doing a .replace(/\/g,’\\’);, but it won’t run. So then I thought I would try:

      var unregged = $(this).attr('ows_DEVPathURLServer');
      var regged = unregged.toString().split('\\').join('\\\\');
      alert(regged);
      var devPath = "<a class='h_link' href='"+regged+"'>"+regged+"</a>";

Just to break down my thought process. Doesn’t work. What am I missing?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:10:16+00:00Added an answer on June 1, 2026 at 6:10 am

    You can simply check if this is location that is “local” and convert it to File URI scheme prior to passing it further.

    Something like this may do the trick:

    var localPathRegex = /^\\(\w)\\/i;
    if (localPathRegex.test(url)){
      url = url.replace(localPathRegex, 'file:///$1:/').replace(/\\/g, '/');
    }
    

    This should convert \d\then\the\path\to\the\file to file:///d:/then/the/path/to/the/file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application written in wpf, which downloads some webpages, parses html code
I have to develop an application which parses a log file and sends specific
I have written a Ruby application which parses lots of data from sources in
I have created an ASP.net application with several aspx. Some of them are used
I want to have an application which parses various RSS feeds and send the
I have application which needs to use a dll (also written by me) which
I have an application which really should be installed, but does work fine when
I have an application which extracts data from an XML file using XPath. If
We have an application which needs to use Direct3D. Specifically, it needs at least
I have an application which behaves as a slideshow for all pictures in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.