How to manipulate url using javascript

has some problems with changing url where filename will change every time.

this is url i am returning from api. the pdf name will be different from evertime

C: / Users / rsanchez / Source / completePdfs / PdfSharpResult-6-23-2015 2-13 PM.pdf

I need to change it to

ViewerJS /#../ completePdfs / PdfSharpResult-6-23-2015 2-13 PM.pdf

what i am trying so far

  var fileURL = result.FileName;
                               fileURL.replace('C:/Users/rsanchez/Source/completePdfs/', 'ViewerJS/#../completePdfs/')
  $scope.returnedPdf = fileURL;
  console.log(fileURL)

      

+3


source to share


1 answer


You do it well. Just assign the update value back to the url file



fileURL = fileURL.replace('C:/Users/rsanchez/Source/completePdfs/', 'ViewerJS/#../completePdfs/')

      

+3


source







All Articles