If you are generating Javascript strings on the server, you will need to escape quotes and certain other characters. You need to escape them like so var foo = foo So, if the source string has single quotes, replace each single quote with a slash and a single quote..Simple jQuery code snippets to replace single quotes and replace double quotes using the jQuery.replace function that uses a blank space to replace them. Login Free Day Trial javascript By Sam Deering .JavaScript single quotes versus double quotes. @tobie “Using single quotes saves bandwidth because you don t have to send the extra .This example will shows you how to replace single quote form a string. Default javascript replace method will replace the first occurrence of the single quote, .
0 Komentar