javascript - Can't remove double quotes from image path after JSON.stringify -


I have a JSO file that has a file path for an image. I am trying to change the source ARTR of an image tag using jQuery, but no matter what I do, as long as I try to change the source, the path to the quotation marks around the file path Finishing encoding is finished and thus fails

I have tried:

  • decodeURIcomponent
  • regex

    Neither worked, but I And more > getPics: function () {$ .ajax ({{type: 'GET', url: this.BASE_URL + 'js / image1.js', data type: "json ", Success: function (data) {var pic = data.images.image [0] .image_one; console.log (pic); setTimeout (function () {var image = JSON.stringify (pic); image = image $ ('^' ("[^ (\") "] +) \": / G, "$ 1:"); Console.log (image); $ ('# pic1 img'). Attr ("src" , Image);}, 5000);}}); }

    This part of the problem is here:

      setTimeout (function () {var image = JSON.stringify (pic); image = image $ ( Attr ("src", "$": "image";}, 5000);   

    Note two console.logs: For 'pic' The first is to print a clean (iew / out quotes) file path. Strangely, console.log prints the same file path for 'image', but now with the evil double quotation marks that the final product fails. The seen regex has no effect.

    Here JSON is back here that I work with it

    > Try it once without JSON.Stink, I think it is not needed.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -