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:
encodeuricomponentdifferencodeuriin 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
Post a Comment