Email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dr John Stockton

    #16
    Re: Email

    JRS: In article <_hAmc.34149$_4 1.2900675@attbi _s02>, seen in
    news:comp.lang. javascript, Brian Wilson <blwilson8@comc ast.net> posted
    at Thu, 6 May 2004 23:57:46 :[color=blue]
    >Yes, it works --- Copy the text below making sure that the document.write
    >line is all on one line.[/color]

    No need for that, if the code is decently formatted :
    [color=blue]
    ><body>
    ><script>docume nt.write("<font size='+1', font face='Times New Roman'>" +
    >"<a href='mailto:"+ myaddress+"?sub ject=Web Mail'" + " class=textlink
    >style=color:bl ack;>"+myaddres s+"</a>");</script>
    ></body>[/color]


    <body>
    <script>
    document.write( "<font size='+1', font face='Times New Roman'>",
    "<a href='mailto:", myaddress, "?subject=W eb Mail'",
    " class=textlink style=color:bla ck;>", myaddress, "</a>");
    </script>
    </body>

    I've not compared the speeds of
    document.write( a + b)
    document.write( a, b)
    but the latter looks easier.

    --
    © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
    <URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
    <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
    <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

    Comment

    • Randy Webb

      #17
      Re: Email

      Dr John Stockton wrote:

      <--snipped code that did not fix the broken mailto problem-->
      [color=blue]
      > I've not compared the speeds of
      > document.write( a + b)
      > document.write( a, b)
      > but the latter looks easier.
      >[/color]

      a = "some text";
      b = " some more text<br />";
      var start1 = new Date();
      for (i=0;i<1000;i++ ){
      document.write (a+b)
      }
      var end1 = new Date();
      var time1 = end1 - start1;
      var start2 = new Date();
      for (i=0;i<1000;i++ ){
      document.write (a,b)
      }
      var end2 = new Date();
      var time2 = end2 - start2;

      document.write( 'a+b took ' + time1 + ' milliseconds<br />');
      document.write( 'a,b took ' + time2 + ' milliseconds<br />');


      IE6:
      a+b took 60 milliseconds
      a,b took 50 milliseconds

      Mozilla 1.6:
      a+b took 390 milliseconds
      a,b took 600 milliseconds

      Opera 7:
      a+b took 160 milliseconds
      a,b took 110 milliseconds

      Mozilla Firefox:
      a+b took 320 milliseconds
      a,b took 610 milliseconds

      --
      Randy
      Chance Favors The Prepared Mind
      comp.lang.javas cript FAQ - http://jibbering.com/faq/

      Comment

      Working...