Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I dynamically add a paragraph to a document without overwriting everything else in javascript?
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COFor me `var doc = iframe.contentDocument || iframe.document;` worked but `var doc = iframe.contentDocument || iframe.contentWindow.document;` didn't, and I was able to add an iframe to the page but then the new paragraph didn't appear for some reason though I didn't get any further errors. As an aside, any reason for the `+=` when setting the iframe height? As a further aside, what's the point of using an iframe in this scenario (other than to prove that you can)?
      singulars
    2. COi was only using the iframe because i'm new at javascript and i just followed the other example i found on this website. i'm sure there are other ways to do it but this is the only way i am aware of so far. and the += was because this is a sample code that i plan on using for a website to add comments to a page, so with each comment, another 50 px in height is added so the new comment can fit. that way it keeps growing to fit all the new comments.
      singulars
    3. COI changed the script up a little bit with your help @nnnnnn, and some other ideas online. the edited script appears above. but i can only get the iframe to appear as a blank box without newParagraph in it. any ideas on that?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload