Web Analytics Made Easy -
StatCounter documen.write problem - CodingForum

Announcement

Collapse
No announcement yet.

documen.write problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • documen.write problem

    Ok, I went here:

    http://www.simonsgroup.com/test/html...avascript.html

    and put some coding in to be converted, and it gave me some stuff I don't understand:


    var code="javascript here";

    I have always used document.write('stuff here'); for my external JS files. What is the difference?

  • #2
    nothing.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

    Comment


    • #3
      Basically all that script is doing for you is converting your HTML or text string into a javascript variable, and then using document.write() to write it out for you.
      Former ASP Forum Moderator - I'm back!

      If you can teach yourself how to learn, you can learn anything. ;)

      Comment


      • #4
        Whammy is 100% right.

        Example

        you normally put (as you said)

        say : document.write("<html><head><title>DD</title></head>")

        all there doing is putting the <html><head> ect. into a javascript variable

        like: var code="<html><head><title>DD</title></head>"

        then there putting it into the document.write

        as: document.write(code)

        by doing that you can cut down on space & its alot neater.
        CYWebmaster.com - See why we dot com!!
        ACJavascripts.com - Cut & Paste Javascripts!
        SimplyProgram.com - Personal Blog

        Comment

        Working...
        X