Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    document.writeln(); TABLES CANT VIEW THEM

    Im trying to view my table through google chrome and i keep getting blank pages ?!?!

    <html>
    <head>
    <title>Assignment1.2
    <body>


    <script language="JavaScript">

    document.write("<table border='1'>");
    document.write("<tr>");
    document.write("<td>");
    document.write("JavaScript Text which may or may not be output");
    document.write("</td>");
    document.write("<td>");
    document.write("JavaScript Text which may or may not be output");
    document.write("</td>");
    document.write("</tr>");
    document.write("</table>");

    </script>


    </body>
    </html>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,147
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    You have not closed your <title> tag.

    Be aware that document.write() is in effect obsolete. document.write() statements must be run before the page finishes loading. Any document.write() statement that runs after the page finishes loading will create a new page and overwrite all of the content of the current page (including the Javascript which called it). So document.write() is at best really only useful to write the original content of your page. It cannot be used to update the content of your page after that page has loaded.

    <script language=javascript> is long deprecated. Use <script type = "text/javascript"> instead (in fact also deprecated but still necessary for IE<9).


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you ! I replaced all with document.writeln(), <script type = "text/javascript"> and closed my title all is good now

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    Quote Originally Posted by Philip M View Post
    <script language=javascript> is long deprecated. Use <script type = "text/javascript"> instead (in fact also deprecated but still necessary for IE<9).
    Just out of curiosity, if even the type attribute is deprecated (except for IE<9), is it being replaced with anything? Or do we no longer have to indicate that the script is JavaScript (for future browsers)?
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,147
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Quote Originally Posted by Ludwig2012 View Post
    Thank you ! I replaced all with document.writeln(), <script type = "text/javascript"> and closed my title all is good now
    Aaarrrggghhh! document.writeln() is as obsolete and useless as document.write(). The only difference is that document.writeln() adds a line feed/carriage return.
    Last edited by Philip M; 07-05-2012 at 03:31 PM. Reason: typo

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,147
    Thanks
    203
    Thanked 2,547 Times in 2,525 Posts
    Quote Originally Posted by WolfShade View Post
    Just out of curiosity, if even the type attribute is deprecated (except for IE<9), is it being replaced with anything? Or do we no longer have to indicate that the script is JavaScript (for future browsers)?
    The approved version is <script type = "application/javascript"> but there are still plenty of browsers around (especially IE<9) that don't recognise it. <script type = "text/javascript"> is fail-safe and works in all browsers. It is the default if just <script> is specified.

    If you only care about HTML 5, just omit the type attribute entirely. It is optional and the default language is JavaScript. But HTML4 browsers will still be around for some years yet!

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #7
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    I haven't started with HMTL5, yet. Last I heard, it still hasn't been standardized. I'll wait for that, before digging into it. And the fact that the HTML4 browsers (as you have stated) will be around for a while, yet.. (shrug)

    But I'm glad to know that type="text/javascript" is fail-safe amongst all browsers.

    Thanks,
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •