On the click of a button I am dynamically adding the following Div to my web page.
The problem is the image source cannot be found due to the incorrect path caused by the backslash just before "\Content". The backslash is already reserved to escape quotes.
How can I workaround this.
$("<div class=\"input-append\"><label style=\"background-color:#e0ffff\">" + artistVal + "</label><img onclick=\"RemoveArtist()\" id=\"removeartist\" src=\"\Content\bootstrap\img\cross-button.png\" /></div>").appendTo(addDiv);
I am getting an error 400 pulling the image added to the div
Request URL:http://myhost:53159/Content%08ootstrapimgcross-button.png
On the click of a button I am dynamically adding the following Div to my web page.
The problem is the image source cannot be found due to the incorrect path caused by the backslash just before "\Content". The backslash is already reserved to escape quotes.
How can I workaround this.
$("<div class=\"input-append\"><label style=\"background-color:#e0ffff\">" + artistVal + "</label><img onclick=\"RemoveArtist()\" id=\"removeartist\" src=\"\Content\bootstrap\img\cross-button.png\" /></div>").appendTo(addDiv);
I am getting an error 400 pulling the image added to the div
Request URL:http://myhost:53159/Content%08ootstrapimgcross-button.png
You can either use double backslashes (\\
) in file paths, or use forward slashes (/
). Using a forward slash is more reliable, since backslashes don't work correctly on all web servers.
Use slash instead of backslash for your src element. This way you avoid the escaping problem inside URLs