Sunday, June 26, 2011

NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7

Since Mibbu framework supports CSS animations, it's good moment to create version exclusively for mobile devices, without using heavy and hard to render canvas, and with very limited JavaScript DOM interactions - CSS FTW! So I remove about 50% of code from original branch and test it on my Samsung Wave (bada has one of the best mobile browsers ever, so that was my starting point). And it simply doesn't work:
NO_MODIFICATION_ALLOWED_ERR: DOM Exception 7
After short research I saw that Allegro ('Polish Ebay') had the same problem on Desktop Chrome months ago. After couple more hours of reading documentation I found a clue, that Webkit is freaking out if you try to put HTML content into style tag. So I switch
var cssStyle = document.createElement('style');
    cssStyle.innerHTML = 'body { color: #000; }';
to
var cssStyle = document.createElement('style');
    cssStyle.innerText = 'body { color: #000; }';
and everything works.

17 comments:

  1. "document.createTextNode" would be the correct and valid for the "W3C"

    ReplyDelete
    Replies
    1. It doesn't make sense, you don't use createTextNode to insert text in your HTML document, do you? Sometimes even if something is 'correct & valid' according to some rules, it doesn't mean it's the best solution.

      Delete
  2. Aw, this was a really great post. In theory I'd like to write like this also - taking time and real effort to make a good article... but what can I say... I procrastinate alot and never seem to get something done. Aplikasi Game iPhone Informasi pc gaming

    ReplyDelete
  3. Thank you for the information , I wait for more information and I ask for a return visit our new website
    >> Obat pembesar penis <<

    ReplyDelete
  4. kini kami akan bahas tentang kesehatan dan kecantikan perawatan tubuh maupun pengobatan secara alami :

    Berikut : obat peninggi badan

    Berikut : obat pembesar payudara

    Berikut : cara merontokan bulu permanen

    Berikut : obat pelangsing badan

    Berikut : cara sehat alami

    Berikut : cara mempercantik wajah dan tubuh

    Berikut : obat penggemuk badan

    Berikut : cara mengobati ejakulasi dini

    Berikut : Obat penyubur seperma

    Berikut : penis bendera

    Berikut : Alat Pembesar Payudara

    Berikut : Viagra

    Berikut : perangsang wanita

    Berikut : alat bantu sex pria

    Berikut : alat bantu sex wanita

    Berikut : boneka full body

    Berikut : Cara memperbesar penis

    Berikut : Oil pembesar penis

    Berikut : Celana Hernia

    Berikut : vimax original

    Berikut : ciri vimax asli

    Berikut : Obat Kuat Sex Pria

    Berikut : Vimax Extender Asli

    Berikut : Obat pembesar penis

    Berikut : Neosize Xl

    TERIMA KASIH

    ReplyDelete
  5. Thank you for sharing in this article
    I can learn a lot and could also be a reference
    I am happy to find your website and can join to comment
    I think is very valuable to be able to read your writing, and on this occasion will I use for my reference source

    Thank you so much for sharing, I hope you continue to write spirit next topic Hammer Of Thor Asli

    ReplyDelete