dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Escape Character Question

  1. #1
    Join Date
    May 2010
    Posts
    2

    resolved [RESOLVED] Escape Character Question

    I have a string that is being concatenated as such

    site_address = site_address.replace("'", "\'");
    site_name = site_name.replace("'", "\'");

    htmlOutput= htmlOutput +"<a href = \'javascript:helperFuncs.panZoomToFeature(\"" + site_name + "\",\"" + site_address + "\",\"" + "\");\'>" + site_name + "</a>";

    The problem is the single quotes are not getting escaped. I tried a regex and that didn't work either.

    Does anyone know what is going on here?

    Thanks

  2. #2
    Join Date
    May 2010
    Posts
    2
    I guess I solved my own problem. Had to use this instead:

    site_name = site_name.replace("'", "%27");

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles