Cannot use CSS '#' symbol in iframe -


scenario

i have created simple iframe dynamically generating user provided html , css.

jsfiddle

https://jsfiddle.net/jaup3769/1/

problem

whenever use '#' symbol, css parsing stopped beyond point.

p#para1{  } 

won't parse beyond p#

similarly,

p{  color: green;  background-color: #ff0000; } 

won't parse beyond background-color: #

what might issue?

just use encodeuricomponent instead of encodeuri. mdn article:

encodeuricomponent differ encodeuri in encode reserved characters , number sign #

i think makes more sense use in code provided, since not encoding whole uri, data:whatever/charset:… part there…


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -