Questions tagged [document.write]

A DOM Level 2 HTML method that writes a string of text to a document stream opened by document.open().

A DOM Level 2 HTML method that writes a string of text to a document stream opened by document.open().

487 questions
3
votes
3 answers

what should I use instead of document.write for a popup

in my web page, I am opening a popup window and generate the HTML for the popup using JavaScript/jQuery: var site=" ............. "; var popupWindow = window.open("","","menubar=0,scrollbars=0"); popupWindow.document.write(site); The…
user1414745
  • 1,317
  • 6
  • 25
  • 45
2
votes
3 answers

what are the downsides of using javascript to build an entire webpage?

A friend of mine is programming a web page. Instead of writing any HTML in the .html file, he is outputting the entire website with javascript. Excluding SEO, or the fact that it will be a pain to debug, what are the downsides to this? Also, if…
ddan
  • 295
  • 1
  • 5
  • 17
2
votes
1 answer

document.write in Chrome Extension

I'm new to this so please bear with me. I am trying to write a chrome extension that does the following: Detect www.website.com/anypage.html. If this website is detected, then do the following. Don't load the URL. Instead, write a blank document…
2
votes
1 answer

document.write nested in document.write

I have an ad tag that a third party is trying to stuff inside of a 'document.write' function and it's not working because the ad tag itself also contains document.write's. Is there a way to shove this ad tag inside of a single instance of…
2
votes
1 answer

is document.write blocking

I would like to insert a script into the page in a blocking way (can't use the src attribute of a script tag unfortunately). Would it block if i inserted the tag via document.write() on all browsers? I know this is a bad way of doing things, but i…
Marius
  • 3,976
  • 5
  • 37
  • 52
2
votes
2 answers

Avoid document.write()

I have tested my website with PageSpeed Insights and i have the following error: Avoid document.write(). I have on my website a javascript code used for tracking visitors: