sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Document.write() cover function

    Scheduled Pinned Locked Moved Developers' Forum
    1 Posts 1 Posters 117 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      MartinRinehart
      last edited by

      I originally wrote dw() as a typist-friendly synonym for document.write(). Then I had it write text to an alert() box if "debug" was set true. It got improved to the following when I found that none of my browsers could manage a scrollbar for an over-length alert() box. (Beer license: if this helps you and we happen to meet, first round is on you.)

      function dw( text ) {
      	if ( debug ) { // in your old line editor; rep /</&lt;/g 
      		document.write( text.replace(new RegExp( '<', 'g' ), '&lt;') + '<br>' );
      	} else {
      		document.write( text );
      	}
      }
      
      

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      • First post
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement