Cloning a background image with parentheses in the file name

I have a background image with a bracket in the file name:

<DIV style="BACKGROUND: url('http://site.com/image(8).png');"></DIV>

This is normal, and there is no confusion because there are quotes around the file name.

However, looking in the IE developer tools, I see that for some reason the browser has separated the quotes.

<DIV style="BACKGROUND: url(http://site.com/image(8).png);"></DIV>

However, this works, so it doesn't matter. The problem occurs when I try to use the jquery clone function.

Apparently, the result after clone () does not recognize the above image URL as valid in IE8 and removes it (other browsers, including IE7, are fine). And so I end up with:

<DIV></DIV>

Does anyone know how to fix this? That is, clone the background image with parentheses in the URL in IE8.

Thanks.

, , , , .

Ad2: , , . , .

+3
4

HTML ( ), URL:

(=% 28
) =% 29

+7

: "

<DIV style="BACKGROUND: url('http://site.com/image(8).png');></DIV>

<DIV style="BACKGROUND: url('http://site.com/image(8).png');"></DIV>

, stackoverflow ,

+2

I think that escaping the parent will work. TBH, I would use it at the url.

0
source

&#40; for the left parenthesis '('

&#41; for the right parenthesis ')'

Perhaps this will fix the problem?

0
source

Source: https://habr.com/ru/post/1713197/


All Articles