I am trying to set a background image from a local source on my computer.
Below are two lines of code, one that works and one that does not: (the local one fails)
_html.style.backgroundImage = 'url("urlsourceblahblahblah")';
_html.style.backgroundImage = 'url("/~/Content/images/Image1.jpg")';
When attempting to run the second line (the local one), an error is encountered:
GET http://localhost:23433/~/Content/images/Image1.jpg 404 (Not Found)
Even though I have verified that the image path is correct, including placing the image in the same directory for simplicity. From what I understand in the documentation, the backgroundImage property in JS requires url(). Are there any reasons why this setup would not be successful?