nesting JS in echo's

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Norman Peelman

    #16
    Re: nesting JS in echo's

    Request-1 wrote:
    "Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
    news:gf2t4m$inr $1@registered.m otzarella.org.. .
    >Request-1 wrote:
    >>hi folks,
    >>>
    >>html coder here, new and terrified * of php!!
    >>aaaaaa!
    >>>
    >>i'm trying to bury a JS script to rotate a photo, in a page i converted
    >>from html to php.
    >>the conversion went well, it was to use a php session cookie to stop the
    >>repeating of an embedded video file on a per session basis;
    >>i amended the php code to display a still pic if the session cookie value
    >>was nil.
    >>>
    >>worked fine.
    >>>
    >>thought I'd try integrating a tested and true JS image random rotator
    >>script into the echo command, but the problem was the syntax of the
    >>single quotes and double quotes needed in the doc.write and variable
    >>sequences in the JS.
    >>>
    >>i tried escaping the double quotes (my echo used double quotes), but to
    >>no avail.
    >>>
    >>here's the JS CODE i use in the tail end of my PHP. "picnumber" is the
    >>variable holding the randomly assigned number that chooses the picture.
    >>>
    >>any help much appreciated..
    >>>
    >>>
    >>+++++++++++++ +++
    >>>
    >>{ echo "
    >>>
    >> <script language='JavaS cript1.2'>
    >> <!-- begin
    >> document.write( \"'<img src='images/swap/'+ picnumber + '.jpg'>\");
    >> // end -->
    >></script>
    >> "; }
    >>>
    >>+++++++++++++ +++++++++++++
    >>>
    >>thanks
    >You have an extra single quote before <img ...
    >
    >
    >
    Hi Jerry,
    >
    the single quote is actually necessary in JS when you're using
    document.write to add strings in series (is it called "concatenat ing" or
    something?). so the <img src...statement was broken down into 3 seperate
    stings to be re-joined - all within the double-quote nested doc.write stmt.
    my mistake was to leave the image path in single quotes; instead I tried
    "escaped double quotes" to complete the image path, like so,
    >
    { echo "<script language='JavaS cript1.2'>\n";
    echo "<!-- begin \n";
    echo "document.write ('<img src=\"images/swap/' + picnumber +'.jpg\"
    width=\"320\" height=\"240\" border=\"0\" alt=\"Fitness Training
    Image\">');\n";
    echo "// end -->\n";
    echo "</script>"; }
    >
    >
    but no avail. still no pic shows up.
    >
    anyway. i get really confused with all the nested stuff and single-double
    quotes. i may try that "heredoc" thing that Thomas suggested. I'll need a
    couple of beers first. Friday night on Javascript? Bad!
    >
    >
    The heredoc is probably the best choice (as i'm not really a big fan
    of dropping in and out of <?PHP ?for some reason, readability I
    guess.) HEREDOC allows variable expansion...


    Take a look at: http://us2.php.net/manual/en/language.types.string.php



    --
    Norman
    Registered Linux user #461062
    -Have you been to www.php.net yet?-

    Comment

    • 703designs

      #17
      Re: nesting JS in echo's

      On Nov 8, 7:47 am, Norman Peelman <npeel...@cfl.r r.comwrote:
      Request-1 wrote:
      "Jerry Stuckle" <jstuck...@attg lobal.netwrote in message
      news:gf2t4m$inr $1@registered.m otzarella.org.. .
      Request-1 wrote:
      >hi folks,
      >
      >html coder here, new and terrified * of php!!
      >aaaaaa!
      >
      >i'm trying to bury a JS script to rotate a photo, in a page i converted
      >from html to php.
      >the conversion went well, it was to use a php session cookie to stop the
      >repeating of an embedded video file on a per session basis;
      >i amended the php code to display a still pic if the session cookie value
      >was nil.
      >
      >worked fine.
      >
      >thought I'd try integrating a tested and true JS image random rotator
      >script into the echo command, but the problem was the syntax of the
      >single quotes and double quotes needed in the doc.write and variable
      >sequences in the JS.
      >
      >i tried escaping the double quotes (my echo used double quotes), but to
      >no avail.
      >
      >here's the JS CODE i use in the tail end of my PHP.  "picnumber" isthe
      >variable holding the randomly assigned number that chooses the picture.
      >
      >any help much appreciated..
      >
      >++++++++++++++ ++
      >
      >{ echo "
      >
      >   <script language='JavaS cript1.2'>
      >        <!-- begin
      >    document.write( \"'<img src='images/swap/'+ picnumber + '.jpg'>\");
      >   // end  -->
      ></script>
      >   "; }
      >
      >++++++++++++++ ++++++++++++
      >
      >thanks
      You have an extra single quote before <img ...
      >
      Hi Jerry,
      >
      the single quote is actually necessary in JS when you're using
      document.write to add strings in series (is it called "concatenat ing" or
      something?).  so the <img src...statement was broken down into 3 seperate
      stings to be re-joined - all within the double-quote nested doc.write stmt.
      my mistake was to leave the image path in single quotes; instead I tried
      "escaped double quotes" to complete the image path, like so,
      >
      { echo "<script language='JavaS cript1.2'>\n";
            echo "<!-- begin \n";
         echo "document.write ('<img src=\"images/swap/' + picnumber +'.jpg\"
      width=\"320\" height=\"240\" border=\"0\" alt=\"Fitness Training
      Image\">');\n";
         echo "// end  -->\n";
         echo "</script>"; }
      >
      but no avail.  still no pic shows up.
      >
      anyway.   i get really confused with all the nested stuff and single-double
      quotes.  i may try that "heredoc" thing that Thomas suggested.  I'll need a
      couple of beers first.   Friday night on Javascript?  Bad!
      >
         The heredoc is probably the best choice (as i'm not really a big fan
      of dropping in and out of <?PHP ?for some reason, readability I
      guess.) HEREDOC allows variable expansion...
      >
      Take a look at:http://us2.php.net/manual/en/language.types.string.php
      >
      --
      Norman
      Registered Linux user #461062
      -Have you been towww.php.netye t?-
      And of course, if you're willing to go a slightly expensive route
      (performance-wise), you could always just make these script(s) a
      separate file and include them where necessary. I think that's the
      cleanest solution as long as you include an HTML comment indicating
      where the code is coming from (a habit of mine).

      Thomas

      Comment

      • Jerry Stuckle

        #18
        Re: nesting JS in echo's

        Seni Seven wrote:
        Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
        >
        >Request-1 wrote:
        >>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
        >>news:gf2t4m$i nr$1@registered .motzarella.org ...
        >>>Request-1 wrote:
        >>>>hi folks,
        >>>>>
        >>>>html coder here, new and terrified * of php!!
        >>>>aaaaaa!
        >>>>>
        >>>>i'm trying to bury a JS script to rotate a photo, in a page i
        >>>>converted from html to php.
        >>>>the conversion went well, it was to use a php session cookie to
        >>>>stop the repeating of an embedded video file on a per session
        >>>>basis; i amended the php code to display a still pic if the session
        >>>>cookie value was nil.
        >>>>>
        >>>>worked fine.
        >>>>>
        >>>>thought I'd try integrating a tested and true JS image random
        >>>>rotator script into the echo command, but the problem was the
        >>>>syntax of the single quotes and double quotes needed in the
        >>>>doc.write and variable sequences in the JS.
        >>>>>
        >>>>i tried escaping the double quotes (my echo used double quotes),
        >>>>but to no avail.
        >>>>>
        >>>>here's the JS CODE i use in the tail end of my PHP. "picnumber" is
        >>>>the variable holding the randomly assigned number that chooses the
        >>>>picture.
        >>>>>
        >>>>any help much appreciated..
        >>>>>
        >>>>>
        >>>>+++++++++++ +++++
        >>>>>
        >>>>{ echo "
        >>>>>
        >>>> <script language='JavaS cript1.2'>
        >>>> <!-- begin
        >>>> document.write( \"'<img src='images/swap/'+ picnumber +
        >>>> '.jpg'>\");
        >>>> // end -->
        >>>></script>
        >>>> "; }
        >>>>>
        >>>>+++++++++++ +++++++++++++++
        >>>>>
        >>>>thanks
        >>>You have an extra single quote before <img ...
        >>>
        >>>
        >>Hi Jerry,
        >>>
        >>the single quote is actually necessary in JS when you're using
        >>document.writ e to add strings in series (is it called "concatenat ing"
        >>or something?). so the <img src...statement was broken down into 3
        >>seperate stings to be re-joined - all within the double-quote nested
        >>doc.write stmt. my mistake was to leave the image path in single
        >>quotes; instead I tried "escaped double quotes" to complete the image
        >>path, like so,
        >>>
        >>{ echo "<script language='JavaS cript1.2'>\n";
        >> echo "<!-- begin \n";
        >> echo "document.write ('<img src=\"images/swap/' + picnumber
        >> +'.jpg\"
        >>width=\"320 \" height=\"240\" border=\"0\" alt=\"Fitness Training
        >>Image\">');\n ";
        >> echo "// end -->\n";
        >> echo "</script>"; }
        >>>
        >>>
        >>but no avail. still no pic shows up.
        >>>
        >>anyway. i get really confused with all the nested stuff and
        >>single-double quotes. i may try that "heredoc" thing that Thomas
        >>suggested. I'll need a couple of beers first. Friday night on
        >>Javascript? Bad!
        >>>
        >>>
        >BTW - you don't need quotes around numeric values like your width,
        >height and border. Only non-numeric data.
        >
        Are you talking about generating strict (X)HTML? Quotes must be on all
        element attributes in that case, regardless of attribute value type.
        >
        >
        1. There is no indication this is XHTML.
        2. You shouldn't use XHTML for web pages - it's not well supported by
        some browser, not the least being IE 6 and 7.

        HTML does NOT require quotes on numeric attributes.

        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstucklex@attgl obal.net
        =============== ===

        Comment

        • 703designs

          #19
          Re: nesting JS in echo's

          On Nov 8, 7:21 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
          Seni Seven wrote:
          Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
          >
          Request-1 wrote:
          >"Jerry Stuckle" <jstuck...@attg lobal.netwrote in message
          >>news:gf2t4m$i nr$1@registered .motzarella.org ...
          >>Request-1 wrote:
          >>>hi folks,
          >
          >>>html coder here, new and terrified * of php!!
          >>>aaaaaa!
          >
          >>>i'm trying to bury a JS script to rotate a photo, in a page i
          >>>converted from html to php.
          >>>the conversion went well, it was to use a php session cookie to
          >>>stop the repeating of an embedded video file on a per session
          >>>basis; i amended the php code to display a still pic if the session
          >>>cookie value was nil.
          >
          >>>worked fine.
          >
          >>>thought I'd try integrating a tested and true JS image random
          >>>rotator script into the echo command, but the problem was the
          >>>syntax of the single quotes and double quotes needed in the
          >>>doc.write and variable sequences in the JS.
          >
          >>>i tried escaping the double quotes (my echo used double quotes),
          >>>but to no avail.
          >
          >>>here's the JS CODE i use in the tail end of my PHP.  "picnumber" is
          >>>the variable holding the randomly assigned number that chooses the
          >>>picture.
          >
          >>>any help much appreciated..
          >
          >>>++++++++++++ ++++
          >
          >>>{ echo "
          >
          >>>   <script language='JavaS cript1.2'>
          >>>        <!-- begin
          >>>    document.write( \"'<img src='images/swap/'+ picnumber +
          >>>    '.jpg'>\");
          >>>   // end  -->
          >>></script>
          >>>   "; }
          >
          >>>++++++++++++ ++++++++++++++
          >
          >>>thanks
          >>You have an extra single quote before <img ...
          >
          >Hi Jerry,
          >
          >the single quote is actually necessary in JS when you're using
          >document.wri te to add strings in series (is it called "concatenat ing"
          >or something?).  so the <img src...statement was broken down into3
          >seperate stings to be re-joined - all within the double-quote nested
          >doc.write stmt. my mistake was to leave the image path in single
          >quotes; instead I tried "escaped double quotes" to complete the image
          >path, like so,
          >
          >{ echo "<script language='JavaS cript1.2'>\n";
          >      echo "<!-- begin \n";
          >   echo "document.write ('<img src=\"images/swap/' + picnumber
          >   +'.jpg\"
          >width=\"320\ " height=\"240\" border=\"0\" alt=\"Fitness Training
          >Image\">');\n" ;
          >   echo "// end  -->\n";
          >   echo "</script>"; }
          >
          >but no avail.  still no pic shows up.
          >
          >anyway.   i get really confused with all the nested stuff and
          >single-double quotes.  i may try that "heredoc" thing that Thomas
          >suggested.  I'll need a couple of beers first.   Friday night on
          >Javascript?  Bad!
          >
          BTW - you don't need quotes around numeric values like your width,
          height and border.  Only non-numeric data.
          >
          Are you talking about generating strict (X)HTML?  Quotes must be on all
          element attributes in that case, regardless of attribute value type.
          >
          1. There is no indication this is XHTML.
          2. You shouldn't use XHTML for web pages - it's not well supported by
          some browser, not the least being IE 6 and 7.
          >
          HTML does NOT require quotes on numeric attributes.
          >
          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstuck...@attgl obal.net
          =============== ===
          Haha, where did you get that from? I've been building sites for ages
          now with the XHTML doctype (transitional or strict, validates) and
          never had any problems. I don't think I've ever had the desire or a
          reason to use single quotes in HTML...

          Thomas

          Comment

          • Jerry Stuckle

            #20
            Re: nesting JS in echo's

            703designs wrote:
            On Nov 8, 7:21 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
            >Seni Seven wrote:
            >>Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
            >>>Request-1 wrote:
            >>>>"Jerry Stuckle" <jstuck...@attg lobal.netwrote in message
            >>>>news:gf2t4m $inr$1@register ed.motzarella.o rg...
            >>>>>Request-1 wrote:
            >>>>>>hi folks,
            >>>>>>html coder here, new and terrified * of php!!
            >>>>>>aaaaaa!
            >>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
            >>>>>>convert ed from html to php.
            >>>>>>the conversion went well, it was to use a php session cookie to
            >>>>>>stop the repeating of an embedded video file on a per session
            >>>>>>basis; i amended the php code to display a still pic if the session
            >>>>>>cookie value was nil.
            >>>>>>worked fine.
            >>>>>>thought I'd try integrating a tested and true JS image random
            >>>>>>rotator script into the echo command, but the problem was the
            >>>>>>syntax of the single quotes and double quotes needed in the
            >>>>>>doc.wri te and variable sequences in the JS.
            >>>>>>i tried escaping the double quotes (my echo used double quotes),
            >>>>>>but to no avail.
            >>>>>>here's the JS CODE i use in the tail end of my PHP. "picnumber" is
            >>>>>>the variable holding the randomly assigned number that chooses the
            >>>>>>picture .
            >>>>>>any help much appreciated..
            >>>>>>+++++++++ +++++++
            >>>>>>{ echo "
            >>>>>> <script language='JavaS cript1.2'>
            >>>>>> <!-- begin
            >>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
            >>>>>> '.jpg'>\");
            >>>>>> // end -->
            >>>>>></script>
            >>>>>> "; }
            >>>>>>+++++++++ +++++++++++++++ ++
            >>>>>>thanks
            >>>>>You have an extra single quote before <img ...
            >>>>Hi Jerry,
            >>>>the single quote is actually necessary in JS when you're using
            >>>>document.wr ite to add strings in series (is it called "concatenat ing"
            >>>>or something?). so the <img src...statement was broken down into 3
            >>>>seperate stings to be re-joined - all within the double-quote nested
            >>>>doc.write stmt. my mistake was to leave the image path in single
            >>>>quotes; instead I tried "escaped double quotes" to complete the image
            >>>>path, like so,
            >>>>{ echo "<script language='JavaS cript1.2'>\n";
            >>>> echo "<!-- begin \n";
            >>>> echo "document.write ('<img src=\"images/swap/' + picnumber
            >>>> +'.jpg\"
            >>>>width=\"320 \" height=\"240\" border=\"0\" alt=\"Fitness Training
            >>>>Image\">'); \n";
            >>>> echo "// end -->\n";
            >>>> echo "</script>"; }
            >>>>but no avail. still no pic shows up.
            >>>>anyway. i get really confused with all the nested stuff and
            >>>>single-double quotes. i may try that "heredoc" thing that Thomas
            >>>>suggested . I'll need a couple of beers first. Friday night on
            >>>>Javascrip t? Bad!
            >>>BTW - you don't need quotes around numeric values like your width,
            >>>height and border. Only non-numeric data.
            >>Are you talking about generating strict (X)HTML? Quotes must be on all
            >>element attributes in that case, regardless of attribute value type.
            >1. There is no indication this is XHTML.
            >2. You shouldn't use XHTML for web pages - it's not well supported by
            >some browser, not the least being IE 6 and 7.
            >>
            >HTML does NOT require quotes on numeric attributes.
            >>
            Haha, where did you get that from? I've been building sites for ages
            now with the XHTML doctype (transitional or strict, validates) and
            never had any problems. I don't think I've ever had the desire or a
            reason to use single quotes in HTML...
            >
            Thomas
            Try google. It's well documented.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Seni Seven

              #21
              Re: nesting JS in echo's

              Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
              Seni Seven wrote:
              >Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
              >>
              >>Request-1 wrote:
              >>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
              >>>news:gf2t4m$ inr$1@registere d.motzarella.or g...
              >>>>Request-1 wrote:
              >>>>>hi folks,
              >>>>>>
              >>>>>html coder here, new and terrified * of php!!
              >>>>>aaaaaa!
              >>>>>>
              >>>>>i'm trying to bury a JS script to rotate a photo, in a page i
              >>>>>converte d from html to php.
              >>>>>the conversion went well, it was to use a php session cookie to
              >>>>>stop the repeating of an embedded video file on a per session
              >>>>>basis; i amended the php code to display a still pic if the session
              >>>>>cookie value was nil.
              >>>>>>
              >>>>>worked fine.
              >>>>>>
              >>>>>thought I'd try integrating a tested and true JS image random
              >>>>>rotator script into the echo command, but the problem was the
              >>>>>syntax of the single quotes and double quotes needed in the
              >>>>>doc.writ e and variable sequences in the JS.
              >>>>>>
              >>>>>i tried escaping the double quotes (my echo used double quotes),
              >>>>>but to no avail.
              >>>>>>
              >>>>>here's the JS CODE i use in the tail end of my PHP. "picnumber" is
              >>>>>the variable holding the randomly assigned number that chooses the
              >>>>>picture.
              >>>>>>
              >>>>>any help much appreciated..
              >>>>>>
              >>>>>>
              >>>>>++++++++++ ++++++
              >>>>>>
              >>>>>{ echo "
              >>>>>>
              >>>>> <script language='JavaS cript1.2'>
              >>>>> <!-- begin
              >>>>> document.write( \"'<img src='images/swap/'+ picnumber +
              >>>>> '.jpg'>\");
              >>>>> // end -->
              >>>>></script>
              >>>>> "; }
              >>>>>>
              >>>>>++++++++++ +++++++++++++++ +
              >>>>>>
              >>>>>thanks
              >>>>You have an extra single quote before <img ...
              >>>>
              >>>>
              >>>Hi Jerry,
              >>>>
              >>>the single quote is actually necessary in JS when you're using
              >>>document.wri te to add strings in series (is it called "concatenat ing"
              >>>or something?). so the <img src...statement was broken down into 3
              >>>seperate stings to be re-joined - all within the double-quote nested
              >>>doc.write stmt. my mistake was to leave the image path in single
              >>>quotes; instead I tried "escaped double quotes" to complete the image
              >>>path, like so,
              >>>>
              >>>{ echo "<script language='JavaS cript1.2'>\n";
              >>> echo "<!-- begin \n";
              >>> echo "document.write ('<img src=\"images/swap/' + picnumber
              >>> +'.jpg\"
              >>>width=\"320\ " height=\"240\" border=\"0\" alt=\"Fitness Training
              >>>Image\">');\ n";
              >>> echo "// end -->\n";
              >>> echo "</script>"; }
              >>>>
              >>>>
              >>>but no avail. still no pic shows up.
              >>>>
              >>>anyway. i get really confused with all the nested stuff and
              >>>single-double quotes. i may try that "heredoc" thing that Thomas
              >>>suggested. I'll need a couple of beers first. Friday night on
              >>>Javascript ? Bad!
              >>>>
              >>>>
              >>BTW - you don't need quotes around numeric values like your width,
              >>height and border. Only non-numeric data.
              >>
              >Are you talking about generating strict (X)HTML? Quotes must be on all
              >element attributes in that case, regardless of attribute value type.
              >>
              >>
              >
              1. There is no indication this is XHTML.
              2. You shouldn't use XHTML for web pages - it's not well supported by
              some browser, not the least being IE 6 and 7.
              Actually, many can and do use XHTML for web pages.

              I looked at this page successfully using IE7. The web document was
              written by NONE OTHER THAN BY THE W3 Consortium itself, the standards-
              setting (they use the term "recommendation s" modestly instead of
              "standards" ) in strict XHTML. Go figure.

              There are various documents that can be googled that specify solutions wo
              using XHTML for broken browsers like Internet Explorer, such as using an
              XML stylesheet also to get around problems with showing XHTML in
              standards-violating, never-get-it-right HTTP clients like Internet
              Explorer. This is not rocket science.
              >
              HTML does NOT require quotes on numeric attributes.
              Actually the HTML 4 recommendation does not assert in any way whatsoever
              that quotes can be omitted for attributes that have numeric values. It
              does allow for their omission, but recommends they always be used. There
              is no indication about whether this recommendation applies to the various
              levels of HTML: strict, transitional, frameset.



              Here is one individual's take on SCRUPULOUSLY quoting all attribute values
              in HTML, which MUST be quoted in every case in XHTML:



              He is or was a regular (long-time) and, I believe, respected contributer
              to the HTML usage newsgroups.

              Comment

              • Seni Seven

                #22
                Re: nesting JS in echo's

                Seni Seven <OneWhoLovesYou @humanitarian.c awrote in comp.lang.php:
                Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                >
                >Seni Seven wrote:
                >>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                >>>
                >>>Request-1 wrote:
                >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                >>>>news:gf2t4m $inr$1@register ed.motzarella.o rg...
                >>>>>Request-1 wrote:
                >>>>>>hi folks,
                >>>>>>>
                >>>>>>html coder here, new and terrified * of php!!
                >>>>>>aaaaaa!
                >>>>>>>
                >>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                >>>>>>convert ed from html to php.
                >>>>>>the conversion went well, it was to use a php session cookie to
                >>>>>>stop the repeating of an embedded video file on a per session
                >>>>>>basis; i amended the php code to display a still pic if the
                >>>>>>session cookie value was nil.
                >>>>>>>
                >>>>>>worked fine.
                >>>>>>>
                >>>>>>thought I'd try integrating a tested and true JS image random
                >>>>>>rotator script into the echo command, but the problem was the
                >>>>>>syntax of the single quotes and double quotes needed in the
                >>>>>>doc.wri te and variable sequences in the JS.
                >>>>>>>
                >>>>>>i tried escaping the double quotes (my echo used double quotes),
                >>>>>>but to no avail.
                >>>>>>>
                >>>>>>here's the JS CODE i use in the tail end of my PHP. "picnumber"
                >>>>>>is the variable holding the randomly assigned number that
                >>>>>>chooses the picture.
                >>>>>>>
                >>>>>>any help much appreciated..
                >>>>>>>
                >>>>>>>
                >>>>>>+++++++++ +++++++
                >>>>>>>
                >>>>>>{ echo "
                >>>>>>>
                >>>>>> <script language='JavaS cript1.2'>
                >>>>>> <!-- begin
                >>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                >>>>>> '.jpg'>\");
                >>>>>> // end -->
                >>>>>></script>
                >>>>>> "; }
                >>>>>>>
                >>>>>>+++++++++ +++++++++++++++ ++
                >>>>>>>
                >>>>>>thanks
                >>>>>You have an extra single quote before <img ...
                >>>>>
                >>>>>
                >>>>Hi Jerry,
                >>>>>
                >>>>the single quote is actually necessary in JS when you're using
                >>>>document.wr ite to add strings in series (is it called
                >>>>"concatenat ing" or something?). so the <img src...statement was
                >>>>broken down into 3 seperate stings to be re-joined - all within
                >>>>the double-quote nested doc.write stmt. my mistake was to leave
                >>>>the image path in single quotes; instead I tried "escaped double
                >>>>quotes" to complete the image path, like so,
                >>>>>
                >>>>{ echo "<script language='JavaS cript1.2'>\n";
                >>>> echo "<!-- begin \n";
                >>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                >>>> +'.jpg\"
                >>>>width=\"320 \" height=\"240\" border=\"0\" alt=\"Fitness Training
                >>>>Image\">'); \n";
                >>>> echo "// end -->\n";
                >>>> echo "</script>"; }
                >>>>>
                >>>>>
                >>>>but no avail. still no pic shows up.
                >>>>>
                >>>>anyway. i get really confused with all the nested stuff and
                >>>>single-double quotes. i may try that "heredoc" thing that Thomas
                >>>>suggested . I'll need a couple of beers first. Friday night on
                >>>>Javascrip t? Bad!
                >>>>>
                >>>>>
                >>>BTW - you don't need quotes around numeric values like your width,
                >>>height and border. Only non-numeric data.
                >>>
                >>Are you talking about generating strict (X)HTML? Quotes must be on
                >>all element attributes in that case, regardless of attribute value
                >>type.
                >>>
                >>>
                >>
                >1. There is no indication this is XHTML.
                >2. You shouldn't use XHTML for web pages - it's not well supported by
                >some browser, not the least being IE 6 and 7.
                >
                Actually, many can and do use XHTML for web pages.
                >
                I looked at this page successfully using IE7. The web document was
                written by NONE OTHER THAN BY THE W3 Consortium itself, the standards-
                setting (they use the term "recommendation s" modestly instead of
                "standards" ) in strict XHTML. Go figure.
                [neglected to give the STRICT XHTML-indicated page]


                >
                There are various documents that can be googled that specify solutions
                wo using XHTML for broken browsers like Internet Explorer, such as
                using an XML stylesheet also to get around problems with showing XHTML
                in standards-violating, never-get-it-right HTTP clients like Internet
                Explorer. This is not rocket science.
                >
                >>
                >HTML does NOT require quotes on numeric attributes.
                >
                Actually the HTML 4 recommendation does not assert in any way
                whatsoever that quotes can be omitted for attributes that have numeric
                values. It does allow for their omission, but recommends they always
                be used. There is no indication about whether this recommendation
                applies to the various levels of HTML: strict, transitional,
                frameset.
                >

                >
                Here is one individual's take on SCRUPULOUSLY quoting all attribute
                values in HTML, which MUST be quoted in every case in XHTML:
                >

                >
                He is or was a regular (long-time) and, I believe, respected
                contributer to the HTML usage newsgroups.
                >


                Comment

                • Jerry Stuckle

                  #23
                  Re: nesting JS in echo's

                  Seni Seven wrote:
                  Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                  >
                  >Seni Seven wrote:
                  >>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                  >>>
                  >>>Request-1 wrote:
                  >>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                  >>>>news:gf2t4m $inr$1@register ed.motzarella.o rg...
                  >>>>>Request-1 wrote:
                  >>>>>>hi folks,
                  >>>>>>>
                  >>>>>>html coder here, new and terrified * of php!!
                  >>>>>>aaaaaa!
                  >>>>>>>
                  >>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                  >>>>>>convert ed from html to php.
                  >>>>>>the conversion went well, it was to use a php session cookie to
                  >>>>>>stop the repeating of an embedded video file on a per session
                  >>>>>>basis; i amended the php code to display a still pic if the session
                  >>>>>>cookie value was nil.
                  >>>>>>>
                  >>>>>>worked fine.
                  >>>>>>>
                  >>>>>>thought I'd try integrating a tested and true JS image random
                  >>>>>>rotator script into the echo command, but the problem was the
                  >>>>>>syntax of the single quotes and double quotes needed in the
                  >>>>>>doc.wri te and variable sequences in the JS.
                  >>>>>>>
                  >>>>>>i tried escaping the double quotes (my echo used double quotes),
                  >>>>>>but to no avail.
                  >>>>>>>
                  >>>>>>here's the JS CODE i use in the tail end of my PHP. "picnumber" is
                  >>>>>>the variable holding the randomly assigned number that chooses the
                  >>>>>>picture .
                  >>>>>>>
                  >>>>>>any help much appreciated..
                  >>>>>>>
                  >>>>>>>
                  >>>>>>+++++++++ +++++++
                  >>>>>>>
                  >>>>>>{ echo "
                  >>>>>>>
                  >>>>>> <script language='JavaS cript1.2'>
                  >>>>>> <!-- begin
                  >>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                  >>>>>> '.jpg'>\");
                  >>>>>> // end -->
                  >>>>>></script>
                  >>>>>> "; }
                  >>>>>>>
                  >>>>>>+++++++++ +++++++++++++++ ++
                  >>>>>>>
                  >>>>>>thanks
                  >>>>>You have an extra single quote before <img ...
                  >>>>>
                  >>>>Hi Jerry,
                  >>>>>
                  >>>>the single quote is actually necessary in JS when you're using
                  >>>>document.wr ite to add strings in series (is it called "concatenat ing"
                  >>>>or something?). so the <img src...statement was broken down into 3
                  >>>>seperate stings to be re-joined - all within the double-quote nested
                  >>>>doc.write stmt. my mistake was to leave the image path in single
                  >>>>quotes; instead I tried "escaped double quotes" to complete the image
                  >>>>path, like so,
                  >>>>>
                  >>>>{ echo "<script language='JavaS cript1.2'>\n";
                  >>>> echo "<!-- begin \n";
                  >>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                  >>>> +'.jpg\"
                  >>>>width=\"320 \" height=\"240\" border=\"0\" alt=\"Fitness Training
                  >>>>Image\">'); \n";
                  >>>> echo "// end -->\n";
                  >>>> echo "</script>"; }
                  >>>>>
                  >>>>>
                  >>>>but no avail. still no pic shows up.
                  >>>>>
                  >>>>anyway. i get really confused with all the nested stuff and
                  >>>>single-double quotes. i may try that "heredoc" thing that Thomas
                  >>>>suggested . I'll need a couple of beers first. Friday night on
                  >>>>Javascrip t? Bad!
                  >>>>>
                  >>>>>
                  >>>BTW - you don't need quotes around numeric values like your width,
                  >>>height and border. Only non-numeric data.
                  >>Are you talking about generating strict (X)HTML? Quotes must be on all
                  >>element attributes in that case, regardless of attribute value type.
                  >>>
                  >>>
                  >1. There is no indication this is XHTML.
                  >2. You shouldn't use XHTML for web pages - it's not well supported by
                  >some browser, not the least being IE 6 and 7.
                  >
                  Actually, many can and do use XHTML for web pages.
                  >
                  I looked at this page successfully using IE7. The web document was
                  written by NONE OTHER THAN BY THE W3 Consortium itself, the standards-
                  setting (they use the term "recommendation s" modestly instead of
                  "standards" ) in strict XHTML. Go figure.
                  >
                  Sure, you CAN make pages which will cater to the different browsers
                  idiosyncrasies, but why? Where is the need for xhtml?
                  There are various documents that can be googled that specify solutions wo
                  using XHTML for broken browsers like Internet Explorer, such as using an
                  XML stylesheet also to get around problems with showing XHTML in
                  standards-violating, never-get-it-right HTTP clients like Internet
                  Explorer. This is not rocket science.
                  >
                  >HTML does NOT require quotes on numeric attributes.
                  >
                  Actually the HTML 4 recommendation does not assert in any way whatsoever
                  that quotes can be omitted for attributes that have numeric values. It
                  does allow for their omission, but recommends they always be used. There
                  is no indication about whether this recommendation applies to the various
                  levels of HTML: strict, transitional, frameset.
                  >

                  >
                  Which backs up my claim that HTML does NOT require quotes on numeric
                  attributes.
                  Here is one individual's take on SCRUPULOUSLY quoting all attribute values
                  in HTML, which MUST be quoted in every case in XHTML:
                  >

                  >
                  He is or was a regular (long-time) and, I believe, respected contributer
                  to the HTML usage newsgroups.
                  So? That's one person's opinion. Worth no more or less than anyone
                  else's opinion.

                  Search enough and you can find an opinion you agree with anywhere on the
                  internet.

                  --
                  =============== ===
                  Remove the "x" from my email address
                  Jerry Stuckle
                  JDS Computer Training Corp.
                  jstucklex@attgl obal.net
                  =============== ===

                  Comment

                  • Seni Seven

                    #24
                    Re: nesting JS in echo's

                    Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                    Seni Seven wrote:
                    >Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                    >>
                    >>Seni Seven wrote:
                    >>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                    >>>>
                    >>>>Request-1 wrote:
                    >>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                    >>>>>news:gf2t4 m$inr$1@registe red.motzarella. org...
                    >>>>>>Request-1 wrote:
                    >>>>>>>hi folks,
                    >>>>>>>>
                    >>>>>>>html coder here, new and terrified * of php!!
                    >>>>>>>aaaaaa !
                    >>>>>>>>
                    >>>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                    >>>>>>>converte d from html to php.
                    >>>>>>>the conversion went well, it was to use a php session cookie to
                    >>>>>>>stop the repeating of an embedded video file on a per session
                    >>>>>>>basis; i amended the php code to display a still pic if the
                    >>>>>>>sessio n cookie value was nil.
                    >>>>>>>>
                    >>>>>>>worked fine.
                    >>>>>>>>
                    >>>>>>>though t I'd try integrating a tested and true JS image random
                    >>>>>>>rotato r script into the echo command, but the problem was the
                    >>>>>>>syntax of the single quotes and double quotes needed in the
                    >>>>>>>doc.writ e and variable sequences in the JS.
                    >>>>>>>>
                    >>>>>>>i tried escaping the double quotes (my echo used double
                    >>>>>>>quotes ), but to no avail.
                    >>>>>>>>
                    >>>>>>>here's the JS CODE i use in the tail end of my PHP.
                    >>>>>>>"picnumb er" is the variable holding the randomly assigned
                    >>>>>>>number that chooses the picture.
                    >>>>>>>>
                    >>>>>>>any help much appreciated..
                    >>>>>>>>
                    >>>>>>>>
                    >>>>>>>++++++++ ++++++++
                    >>>>>>>>
                    >>>>>>>{ echo "
                    >>>>>>>>
                    >>>>>>> <script language='JavaS cript1.2'>
                    >>>>>>> <!-- begin
                    >>>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                    >>>>>>> '.jpg'>\");
                    >>>>>>> // end -->
                    >>>>>>></script>
                    >>>>>>> "; }
                    >>>>>>>>
                    >>>>>>>++++++++ +++++++++++++++ +++
                    >>>>>>>>
                    >>>>>>>thanks
                    >>>>>>You have an extra single quote before <img ...
                    >>>>>>
                    >>>>>Hi Jerry,
                    >>>>>>
                    >>>>>the single quote is actually necessary in JS when you're using
                    >>>>>document.w rite to add strings in series (is it called
                    >>>>>"concatena ting" or something?). so the <img src...statement
                    >>>>>was broken down into 3 seperate stings to be re-joined - all
                    >>>>>within the double-quote nested doc.write stmt. my mistake was to
                    >>>>>leave the image path in single quotes; instead I tried "escaped
                    >>>>>double quotes" to complete the image path, like so,
                    >>>>>>
                    >>>>>{ echo "<script language='JavaS cript1.2'>\n";
                    >>>>> echo "<!-- begin \n";
                    >>>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                    >>>>> +'.jpg\"
                    >>>>>width=\"32 0\" height=\"240\" border=\"0\" alt=\"Fitness Training
                    >>>>>Image\">') ;\n";
                    >>>>> echo "// end -->\n";
                    >>>>> echo "</script>"; }
                    >>>>>>
                    >>>>>>
                    >>>>>but no avail. still no pic shows up.
                    >>>>>>
                    >>>>>anyway. i get really confused with all the nested stuff and
                    >>>>>single-double quotes. i may try that "heredoc" thing that Thomas
                    >>>>>suggeste d. I'll need a couple of beers first. Friday night on
                    >>>>>Javascript ? Bad!
                    >>>>>>
                    >>>>>>
                    >>>>BTW - you don't need quotes around numeric values like your width,
                    >>>>height and border. Only non-numeric data.
                    >>>Are you talking about generating strict (X)HTML? Quotes must be on
                    >>>all element attributes in that case, regardless of attribute value
                    >>>type.
                    >>>>
                    >>>>
                    >>1. There is no indication this is XHTML.
                    >>2. You shouldn't use XHTML for web pages - it's not well supported
                    >>by some browser, not the least being IE 6 and 7.
                    >>
                    >Actually, many can and do use XHTML for web pages.
                    >>
                    >I looked at this page successfully using IE7. The web document was
                    >written by NONE OTHER THAN BY THE W3 Consortium itself, the
                    >standards- setting (they use the term "recommendation s" modestly
                    >instead of "standards" ) in strict XHTML. Go figure.
                    >>
                    >
                    Sure, you CAN make pages which will cater to the different browsers
                    idiosyncrasies, but why? Where is the need for xhtml?
                    >
                    >There are various documents that can be googled that specify
                    >solutions wo using XHTML for broken browsers like Internet Explorer,
                    >such as using an XML stylesheet also to get around problems with
                    >showing XHTML in standards-violating, never-get-it-right HTTP clients
                    >like Internet Explorer. This is not rocket science.
                    >>
                    >>HTML does NOT require quotes on numeric attributes.
                    >>
                    >Actually the HTML 4 recommendation does not assert in any way
                    >whatsoever that quotes can be omitted for attributes that have
                    >numeric values. It does allow for their omission, but recommends
                    >they always be used. There is no indication about whether this
                    >recommendati on applies to the various levels of HTML: strict,
                    >transitional , frameset.
                    >>
                    >http://www.w3.org/TR/html4/intro/sgm...tml#attributes
                    >>
                    >
                    Which backs up my claim that HTML does NOT require quotes on numeric
                    attributes.
                    If you really want to split hairs, as you apparently want to do, the
                    loosest usage of HTML doesn't require quotes on any attribute values
                    except in the very few circumstances that your determined attempts to
                    confuse the browser do not achieve the rendering you desire.
                    >
                    >Here is one individual's take on SCRUPULOUSLY quoting all attribute
                    >values in HTML, which MUST be quoted in every case in XHTML:
                    >>
                    >http://www.cs.tut.fi/~jkorpela/qattr.html
                    >>
                    >He is or was a regular (long-time) and, I believe, respected
                    >contributer to the HTML usage newsgroups.
                    >
                    So? That's one person's opinion. Worth no more or less than anyone
                    else's opinion.
                    Actually, the HTML standards keepers RECOMMEND (though they don't REQUIRE)
                    you to quote attribute values----ALL OF THEM.

                    But then you have already established that you are a hair-splitter.

                    Perhaps you'd like to disparage the "opinions" of the HTML standards
                    keepers too?
                    Search enough and you can find an opinion you agree with anywhere on
                    the internet.
                    Precisely right!

                    But then I am not so desperate to support my claims on the sole "opinion"
                    of one kook with a web page against the 99,999 opinions of people who
                    impress me with reason and logic and a certain level of erudition, some of
                    whom actually sit on standards-setting committees like the one that
                    promulgates the HTML specification.

                    Oh my!

                    A new word of the day:

                    general agreement (as of opinion or fact) among a group of people or things; the judgment arrived at by most of those concerned; group solidarity in sentiment and belief… See the full definition

                    Comment

                    • Jerry Stuckle

                      #25
                      Re: nesting JS in echo's

                      Seni Seven wrote:
                      Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                      >
                      >Seni Seven wrote:
                      >>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                      >>>
                      >>>Seni Seven wrote:
                      >>>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                      >>>>>
                      >>>>>Request-1 wrote:
                      >>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                      >>>>>>news:gf2t 4m$inr$1@regist ered.motzarella .org...
                      >>>>>>>Reques t-1 wrote:
                      >>>>>>>>hi folks,
                      >>>>>>>>>
                      >>>>>>>>html coder here, new and terrified * of php!!
                      >>>>>>>>aaaaa a!
                      >>>>>>>>>
                      >>>>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                      >>>>>>>>convert ed from html to php.
                      >>>>>>>>the conversion went well, it was to use a php session cookie to
                      >>>>>>>>stop the repeating of an embedded video file on a per session
                      >>>>>>>>basis ; i amended the php code to display a still pic if the
                      >>>>>>>>sessi on cookie value was nil.
                      >>>>>>>>>
                      >>>>>>>>worke d fine.
                      >>>>>>>>>
                      >>>>>>>>thoug ht I'd try integrating a tested and true JS image random
                      >>>>>>>>rotat or script into the echo command, but the problem was the
                      >>>>>>>>synta x of the single quotes and double quotes needed in the
                      >>>>>>>>doc.wri te and variable sequences in the JS.
                      >>>>>>>>>
                      >>>>>>>>i tried escaping the double quotes (my echo used double
                      >>>>>>>>quotes) , but to no avail.
                      >>>>>>>>>
                      >>>>>>>>here' s the JS CODE i use in the tail end of my PHP.
                      >>>>>>>>"picnum ber" is the variable holding the randomly assigned
                      >>>>>>>>numbe r that chooses the picture.
                      >>>>>>>>>
                      >>>>>>>>any help much appreciated..
                      >>>>>>>>>
                      >>>>>>>>>
                      >>>>>>>>+++++++ +++++++++
                      >>>>>>>>>
                      >>>>>>>>{ echo "
                      >>>>>>>>>
                      >>>>>>>> <script language='JavaS cript1.2'>
                      >>>>>>>> <!-- begin
                      >>>>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                      >>>>>>>> '.jpg'>\");
                      >>>>>>>> // end -->
                      >>>>>>>></script>
                      >>>>>>>> "; }
                      >>>>>>>>>
                      >>>>>>>>+++++++ +++++++++++++++ ++++
                      >>>>>>>>>
                      >>>>>>>>thank s
                      >>>>>>>You have an extra single quote before <img ...
                      >>>>>>Hi Jerry,
                      >>>>>>>
                      >>>>>>the single quote is actually necessary in JS when you're using
                      >>>>>>document. write to add strings in series (is it called
                      >>>>>>"concaten ating" or something?). so the <img src...statement
                      >>>>>>was broken down into 3 seperate stings to be re-joined - all
                      >>>>>>within the double-quote nested doc.write stmt. my mistake was to
                      >>>>>>leave the image path in single quotes; instead I tried "escaped
                      >>>>>>double quotes" to complete the image path, like so,
                      >>>>>>>
                      >>>>>>{ echo "<script language='JavaS cript1.2'>\n";
                      >>>>>> echo "<!-- begin \n";
                      >>>>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                      >>>>>> +'.jpg\"
                      >>>>>>width=\"3 20\" height=\"240\" border=\"0\" alt=\"Fitness Training
                      >>>>>>Image\">' );\n";
                      >>>>>> echo "// end -->\n";
                      >>>>>> echo "</script>"; }
                      >>>>>>>
                      >>>>>>>
                      >>>>>>but no avail. still no pic shows up.
                      >>>>>>>
                      >>>>>>anyway. i get really confused with all the nested stuff and
                      >>>>>>single-double quotes. i may try that "heredoc" thing that Thomas
                      >>>>>>suggested . I'll need a couple of beers first. Friday night on
                      >>>>>>Javascrip t? Bad!
                      >>>>>>>
                      >>>>>>>
                      >>>>>BTW - you don't need quotes around numeric values like your width,
                      >>>>>height and border. Only non-numeric data.
                      >>>>Are you talking about generating strict (X)HTML? Quotes must be on
                      >>>>all element attributes in that case, regardless of attribute value
                      >>>>type.
                      >>>>>
                      >>>>>
                      >>>1. There is no indication this is XHTML.
                      >>>2. You shouldn't use XHTML for web pages - it's not well supported
                      >>>by some browser, not the least being IE 6 and 7.
                      >>Actually, many can and do use XHTML for web pages.
                      >>>
                      >>I looked at this page successfully using IE7. The web document was
                      >>written by NONE OTHER THAN BY THE W3 Consortium itself, the
                      >>standards- setting (they use the term "recommendation s" modestly
                      >>instead of "standards" ) in strict XHTML. Go figure.
                      >>>
                      >Sure, you CAN make pages which will cater to the different browsers
                      >idiosyncrasies , but why? Where is the need for xhtml?
                      >>
                      >>There are various documents that can be googled that specify
                      >>solutions wo using XHTML for broken browsers like Internet Explorer,
                      >>such as using an XML stylesheet also to get around problems with
                      >>showing XHTML in standards-violating, never-get-it-right HTTP clients
                      >>like Internet Explorer. This is not rocket science.
                      >>>
                      >>>HTML does NOT require quotes on numeric attributes.
                      >>Actually the HTML 4 recommendation does not assert in any way
                      >>whatsoever that quotes can be omitted for attributes that have
                      >>numeric values. It does allow for their omission, but recommends
                      >>they always be used. There is no indication about whether this
                      >>recommendatio n applies to the various levels of HTML: strict,
                      >>transitiona l, frameset.
                      >>>
                      >>http://www.w3.org/TR/html4/intro/sgm...tml#attributes
                      >>>
                      >Which backs up my claim that HTML does NOT require quotes on numeric
                      >attributes.
                      >
                      If you really want to split hairs, as you apparently want to do, the
                      loosest usage of HTML doesn't require quotes on any attribute values
                      except in the very few circumstances that your determined attempts to
                      confuse the browser do not achieve the rendering you desire.
                      >
                      >>Here is one individual's take on SCRUPULOUSLY quoting all attribute
                      >>values in HTML, which MUST be quoted in every case in XHTML:
                      >>>
                      >>http://www.cs.tut.fi/~jkorpela/qattr.html
                      >>>
                      >>He is or was a regular (long-time) and, I believe, respected
                      >>contributer to the HTML usage newsgroups.
                      >So? That's one person's opinion. Worth no more or less than anyone
                      >else's opinion.
                      >
                      Actually, the HTML standards keepers RECOMMEND (though they don't REQUIRE)
                      you to quote attribute values----ALL OF THEM.
                      >
                      But then you have already established that you are a hair-splitter.
                      >
                      Perhaps you'd like to disparage the "opinions" of the HTML standards
                      keepers too?
                      >
                      >Search enough and you can find an opinion you agree with anywhere on
                      >the internet.
                      >
                      Precisely right!
                      >
                      But then I am not so desperate to support my claims on the sole "opinion"
                      of one kook with a web page against the 99,999 opinions of people who
                      impress me with reason and logic and a certain level of erudition, some of
                      whom actually sit on standards-setting committees like the one that
                      promulgates the HTML specification.
                      >
                      Oh my!
                      >
                      A new word of the day:
                      >
                      http://www.merriam-webster.com/dictionary/consensus
                      For starters:



                      "Trident layout engine, fully supports HTML 4.01, CSS Level 1, XML 1.0
                      and DOM Level 1, with minor implementation gaps. It partially supports
                      CSS Level 2 and DOM Level 2, with major implementation gaps and
                      conformance issues. Full conformance to the CSS 2.1 specification is on
                      the agenda for the final Internet Explorer 8 release.[32] It has no
                      support for XHTML, though it can render XHTML documents authored with
                      HTML compatibility principles and served with a text/html MIME-type."

                      And tens of thousands of similar pages.

                      --
                      =============== ===
                      Remove the "x" from my email address
                      Jerry Stuckle
                      JDS Computer Training Corp.
                      jstucklex@attgl obal.net
                      =============== ===

                      Comment

                      • 703designs

                        #26
                        Re: nesting JS in echo's

                        On Nov 9, 6:44 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                        Seni Seven wrote:
                        Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
                        >
                        Seni Seven wrote:
                        >Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
                        >
                        >>Seni Seven wrote:
                        >>>Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
                        >
                        >>>>Request-1 wrote:
                        >>>>>"Jerry Stuckle" <jstuck...@attg lobal.netwrote in message
                        >>>>>>news:gf2t 4m$inr$1@regist ered.motzarella .org...
                        >>>>>>Request-1 wrote:
                        >>>>>>>hi folks,
                        >
                        >>>>>>>html coder here, new and terrified * of php!!
                        >>>>>>>aaaaaa !
                        >
                        >>>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                        >>>>>>>converte d from html to php.
                        >>>>>>>the conversion went well, it was to use a php session cookie to
                        >>>>>>>stop the repeating of an embedded video file on a per session
                        >>>>>>>basis; i amended the php code to display a still pic if the
                        >>>>>>>sessio n cookie value was nil.
                        >
                        >>>>>>>worked fine.
                        >
                        >>>>>>>though t I'd try integrating a tested and true JS image random
                        >>>>>>>rotato r script into the echo command, but the problem was the
                        >>>>>>>syntax of the single quotes and double quotes needed in the
                        >>>>>>>doc.writ e and variable sequences in the JS.
                        >
                        >>>>>>>i tried escaping the double quotes (my echo used double
                        >>>>>>>quotes ), but to no avail.
                        >
                        >>>>>>>here's the JS CODE i use in the tail end of my PHP.
                        >>>>>>>"picnumb er" is the variable holding the randomly assigned
                        >>>>>>>number that chooses the picture.
                        >
                        >>>>>>>any help much appreciated..
                        >
                        >>>>>>>++++++++ ++++++++
                        >
                        >>>>>>>{ echo "
                        >
                        >>>>>>>   <script language='JavaS cript1.2'>
                        >>>>>>>        <!-- begin
                        >>>>>>>    document.write( \"'<img src='images/swap/'+ picnumber +
                        >>>>>>>    '.jpg'>\");
                        >>>>>>>   // end  -->
                        >>>>>>></script>
                        >>>>>>>   "; }
                        >
                        >>>>>>>++++++++ +++++++++++++++ +++
                        >
                        >>>>>>>thanks
                        >>>>>>You have an extra single quote before <img ...
                        >>>>>Hi Jerry,
                        >
                        >>>>>the single quote is actually necessary in JS when you're using
                        >>>>>document.w rite to add strings in series (is it called
                        >>>>>"concatena ting" or something?).  so the <img src...statement
                        >>>>>was broken down into 3 seperate stings to be re-joined - all
                        >>>>>within the double-quote nested doc.write stmt. my mistake was to
                        >>>>>leave the image path in single quotes; instead I tried "escaped
                        >>>>>double quotes" to complete the image path, like so,
                        >
                        >>>>>{ echo "<script language='JavaS cript1.2'>\n";
                        >>>>>      echo "<!-- begin \n";
                        >>>>>   echo "document.write ('<img src=\"images/swap/' + picnumber
                        >>>>>   +'.jpg\"
                        >>>>>width=\"32 0\" height=\"240\" border=\"0\" alt=\"Fitness Training
                        >>>>>Image\">') ;\n";
                        >>>>>   echo "// end  -->\n";
                        >>>>>   echo "</script>"; }
                        >
                        >>>>>but no avail.  still no pic shows up.
                        >
                        >>>>>anyway.   i get really confused with all the nested stuff and
                        >>>>>single-double quotes.  i may try that "heredoc" thing that Thomas
                        >>>>>suggeste d.  I'll need a couple of beers first.   Friday nighton
                        >>>>>Javascript ?  Bad!
                        >
                        >>>>BTW - you don't need quotes around numeric values like your width,
                        >>>>height and border.  Only non-numeric data.
                        >>>Are you talking about generating strict (X)HTML?  Quotes must be on
                        >>>all element attributes in that case, regardless of attribute value
                        >>>type.
                        >
                        >>1. There is no indication this is XHTML.
                        >>2. You shouldn't use XHTML for web pages - it's not well supported
                        >>by some browser, not the least being IE 6 and 7.
                        >Actually, many can and do use XHTML for web pages.  
                        >
                        >I looked at this page successfully using IE7.  The web document was
                        >written by NONE OTHER THAN BY THE W3 Consortium itself, the
                        >standards- setting (they use the term "recommendation s" modestly
                        >instead of "standards" ) in strict XHTML.  Go figure.  
                        >
                        Sure, you CAN make pages which will cater to the different browsers
                        idiosyncrasies, but why?  Where is the need for xhtml?
                        >
                        >There are various documents that can be googled that specify
                        >solutions wo using XHTML for broken browsers like Internet Explorer,
                        >such as using an XML stylesheet also to get around problems with
                        >showing XHTML in standards-violating, never-get-it-right HTTP clients
                        >like Internet Explorer.  This is not rocket science.
                        >
                        >>HTML does NOT require quotes on numeric attributes.
                        >Actually the HTML 4 recommendation does not assert in any way
                        >whatsoever that quotes can be omitted for attributes that have
                        >numeric values.  It does allow for their omission, but recommends
                        >they always be used.  There is no indication about whether this
                        >recommendati on applies to the various levels of HTML:  strict,
                        >transitional , frameset.
                        >>
                        Which backs up my claim that HTML does NOT require quotes on numeric
                        attributes.
                        >
                        If you really want to split hairs, as you apparently want to do, the
                        loosest usage of HTML doesn't require quotes on any attribute values
                        except in the very few circumstances that your determined attempts to
                        confuse the browser do not achieve the rendering you desire.
                        >
                        >Here is one individual's take on SCRUPULOUSLY quoting all attribute
                        >values in HTML, which MUST be quoted in every case in XHTML:
                        >>
                        >He is or was a regular (long-time) and, I believe, respected
                        >contributer to the HTML usage newsgroups.
                        So?  That's one person's opinion.  Worth no more or less than anyone
                        else's opinion.
                        >
                        Actually, the HTML standards keepers RECOMMEND (though they don't REQUIRE)
                        you to quote attribute values----ALL OF THEM.
                        >
                        But then you have already established that you are a hair-splitter.
                        >
                        Perhaps you'd like to disparage the "opinions" of the HTML standards
                        keepers too?
                        >
                        Search enough and you can find an opinion you agree with anywhere on
                        the internet.
                        >
                        Precisely right!
                        >
                        But then I am not so desperate to support my claims on the sole "opinion"
                        of one kook with a web page against the 99,999 opinions of people who
                        impress me with reason and logic and a certain level of erudition, someof
                        whom actually sit on standards-setting committees like the one that
                        promulgates the HTML specification.
                        >
                        Oh my!
                        >
                        A new word of the day:  
                        >>
                        For starters:
                        >

                        >
                        "Trident layout engine, fully supports HTML 4.01, CSS Level 1, XML 1.0
                        and DOM Level 1, with minor implementation gaps. It partially supports
                        CSS Level 2 and DOM Level 2, with major implementation gaps and
                        conformance issues. Full conformance to the CSS 2.1 specification is on
                        the agenda for the final Internet Explorer 8 release.[32] It has no
                        support for XHTML, though it can render XHTML documents authored with
                        HTML compatibility principles and served with a text/html MIME-type."
                        >
                        And tens of thousands of similar pages.
                        >
                        --
                        =============== ===
                        Remove the "x" from my email address
                        Jerry Stuckle
                        JDS Computer Training Corp.
                        jstuck...@attgl obal.net
                        =============== ===
                        You may be technically right, but I think that you're practically
                        wrong. By that, I mean that I don't think anyone writes HTML
                        differently from XHTML. So we have the illusion that IE works with
                        XHTML. I'm not sure what is meant by "compatibil ity principles"
                        though.

                        Thomas

                        Comment

                        • Jerry Stuckle

                          #27
                          Re: nesting JS in echo's

                          703designs wrote:
                          On Nov 9, 6:44 pm, Jerry Stuckle <jstuck...@attg lobal.netwrote:
                          >Seni Seven wrote:
                          >>Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
                          >>>Seni Seven wrote:
                          >>>>Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
                          >>>>>Seni Seven wrote:
                          >>>>>>Jerry Stuckle <jstuck...@attg lobal.netwrote in comp.lang.php:
                          >>>>>>>Reques t-1 wrote:
                          >>>>>>>>"Jerr y Stuckle" <jstuck...@attg lobal.netwrote in message
                          >>>>>>>>news:gf 2t4m$inr$1@regi stered.motzarel la.org...
                          >>>>>>>>>Reques t-1 wrote:
                          >>>>>>>>>>hi folks,
                          >>>>>>>>>>htm l coder here, new and terrified * of php!!
                          >>>>>>>>>>aaaaa a!
                          >>>>>>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                          >>>>>>>>>>conve rted from html to php.
                          >>>>>>>>>>the conversion went well, it was to use a php session cookie to
                          >>>>>>>>>>sto p the repeating of an embedded video file on a per session
                          >>>>>>>>>>basis ; i amended the php code to display a still pic if the
                          >>>>>>>>>>sessi on cookie value was nil.
                          >>>>>>>>>>worke d fine.
                          >>>>>>>>>>thoug ht I'd try integrating a tested and true JS image random
                          >>>>>>>>>>rotat or script into the echo command, but the problem was the
                          >>>>>>>>>>synta x of the single quotes and double quotes needed in the
                          >>>>>>>>>>doc.w rite and variable sequences in the JS.
                          >>>>>>>>>>i tried escaping the double quotes (my echo used double
                          >>>>>>>>>>quote s), but to no avail.
                          >>>>>>>>>>here' s the JS CODE i use in the tail end of my PHP.
                          >>>>>>>>>>"picn umber" is the variable holding the randomly assigned
                          >>>>>>>>>>numbe r that chooses the picture.
                          >>>>>>>>>>any help much appreciated..
                          >>>>>>>>>>+++++ +++++++++++
                          >>>>>>>>>>{ echo "
                          >>>>>>>>>> <script language='JavaS cript1.2'>
                          >>>>>>>>>> <!-- begin
                          >>>>>>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                          >>>>>>>>>> '.jpg'>\");
                          >>>>>>>>>> // end -->
                          >>>>>>>>>></script>
                          >>>>>>>>>> "; }
                          >>>>>>>>>>+++++ +++++++++++++++ ++++++
                          >>>>>>>>>>thank s
                          >>>>>>>>>You have an extra single quote before <img ...
                          >>>>>>>>Hi Jerry,
                          >>>>>>>>the single quote is actually necessary in JS when you're using
                          >>>>>>>>documen t.write to add strings in series (is it called
                          >>>>>>>>"concat enating" or something?). so the <img src...statement
                          >>>>>>>>was broken down into 3 seperate stings to be re-joined - all
                          >>>>>>>>withi n the double-quote nested doc.write stmt. my mistake was to
                          >>>>>>>>leave the image path in single quotes; instead I tried "escaped
                          >>>>>>>>doubl e quotes" to complete the image path, like so,
                          >>>>>>>>{ echo "<script language='JavaS cript1.2'>\n";
                          >>>>>>>> echo "<!-- begin \n";
                          >>>>>>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                          >>>>>>>> +'.jpg\"
                          >>>>>>>>width=\ "320\" height=\"240\" border=\"0\" alt=\"Fitness Training
                          >>>>>>>>Image\" >');\n";
                          >>>>>>>> echo "// end -->\n";
                          >>>>>>>> echo "</script>"; }
                          >>>>>>>>but no avail. still no pic shows up.
                          >>>>>>>>anywa y. i get really confused with all the nested stuff and
                          >>>>>>>>singl e-double quotes. i may try that "heredoc" thing that Thomas
                          >>>>>>>>suggest ed. I'll need a couple of beers first. Friday night on
                          >>>>>>>>Javascr ipt? Bad!
                          >>>>>>>BTW - you don't need quotes around numeric values like your width,
                          >>>>>>>height and border. Only non-numeric data.
                          >>>>>>Are you talking about generating strict (X)HTML? Quotes must be on
                          >>>>>>all element attributes in that case, regardless of attribute value
                          >>>>>>type.
                          >>>>>1. There is no indication this is XHTML.
                          >>>>>2. You shouldn't use XHTML for web pages - it's not well supported
                          >>>>>by some browser, not the least being IE 6 and 7.
                          >>>>Actually, many can and do use XHTML for web pages.
                          >>>>I looked at this page successfully using IE7. The web document was
                          >>>>written by NONE OTHER THAN BY THE W3 Consortium itself, the
                          >>>>standards- setting (they use the term "recommendation s" modestly
                          >>>>instead of "standards" ) in strict XHTML. Go figure.
                          >>>Sure, you CAN make pages which will cater to the different browsers
                          >>>idiosyncrasi es, but why? Where is the need for xhtml?
                          >>>>There are various documents that can be googled that specify
                          >>>>solutions wo using XHTML for broken browsers like Internet Explorer,
                          >>>>such as using an XML stylesheet also to get around problems with
                          >>>>showing XHTML in standards-violating, never-get-it-right HTTP clients
                          >>>>like Internet Explorer. This is not rocket science.
                          >>>>>HTML does NOT require quotes on numeric attributes.
                          >>>>Actually the HTML 4 recommendation does not assert in any way
                          >>>>whatsoeve r that quotes can be omitted for attributes that have
                          >>>>numeric values. It does allow for their omission, but recommends
                          >>>>they always be used. There is no indication about whether this
                          >>>>recommendat ion applies to the various levels of HTML: strict,
                          >>>>transitiona l, frameset.
                          >>>>http://www.w3.org/TR/html4/intro/sgm...tml#attributes
                          >>>Which backs up my claim that HTML does NOT require quotes on numeric
                          >>>attributes .
                          >>If you really want to split hairs, as you apparently want to do, the
                          >>loosest usage of HTML doesn't require quotes on any attribute values
                          >>except in the very few circumstances that your determined attempts to
                          >>confuse the browser do not achieve the rendering you desire.
                          >>>>Here is one individual's take on SCRUPULOUSLY quoting all attribute
                          >>>>values in HTML, which MUST be quoted in every case in XHTML:
                          >>>>http://www.cs.tut.fi/~jkorpela/qattr.html
                          >>>>He is or was a regular (long-time) and, I believe, respected
                          >>>>contribut er to the HTML usage newsgroups.
                          >>>So? That's one person's opinion. Worth no more or less than anyone
                          >>>else's opinion.
                          >>Actually, the HTML standards keepers RECOMMEND (though they don't REQUIRE)
                          >>you to quote attribute values----ALL OF THEM.
                          >>But then you have already established that you are a hair-splitter.
                          >>Perhaps you'd like to disparage the "opinions" of the HTML standards
                          >>keepers too?
                          >>>Search enough and you can find an opinion you agree with anywhere on
                          >>>the internet.
                          >>Precisely right!
                          >>But then I am not so desperate to support my claims on the sole "opinion"
                          >>of one kook with a web page against the 99,999 opinions of people who
                          >>impress me with reason and logic and a certain level of erudition, some of
                          >>whom actually sit on standards-setting committees like the one that
                          >>promulgates the HTML specification.
                          >>Oh my!
                          >>A new word of the day:
                          >> http://www.merriam-webster.com/dictionary/consensus
                          >For starters:
                          >>
                          >http://en.wikipedia.org/wiki/Internet_Explorer
                          >>
                          >"Trident layout engine, fully supports HTML 4.01, CSS Level 1, XML 1.0
                          >and DOM Level 1, with minor implementation gaps. It partially supports
                          >CSS Level 2 and DOM Level 2, with major implementation gaps and
                          >conformance issues. Full conformance to the CSS 2.1 specification is on
                          >the agenda for the final Internet Explorer 8 release.[32] It has no
                          >support for XHTML, though it can render XHTML documents authored with
                          >HTML compatibility principles and served with a text/html MIME-type."
                          >>
                          >And tens of thousands of similar pages.
                          >>
                          >--
                          >============== ====
                          >Remove the "x" from my email address
                          >Jerry Stuckle
                          >JDS Computer Training Corp.
                          >jstuck...@attg lobal.net
                          >============== ====
                          >
                          You may be technically right, but I think that you're practically
                          wrong. By that, I mean that I don't think anyone writes HTML
                          differently from XHTML. So we have the illusion that IE works with
                          XHTML. I'm not sure what is meant by "compatibil ity principles"
                          though.
                          >
                          Thomas
                          If you're "technicall y right", then you can't be "practicall y wrong".
                          If they're writing XHTML, it's not supported. If they're writing HTML,
                          they shouldn't be calling it XHTML.

                          --
                          =============== ===
                          Remove the "x" from my email address
                          Jerry Stuckle
                          JDS Computer Training Corp.
                          jstucklex@attgl obal.net
                          =============== ===

                          Comment

                          • Seni Seven

                            #28
                            Re: nesting JS in echo's

                            Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                            Seni Seven wrote:
                            >Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                            >>
                            >>Seni Seven wrote:
                            >>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                            >>>>
                            >>>>Seni Seven wrote:
                            >>>>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                            >>>>>>
                            >>>>>>Request-1 wrote:
                            >>>>>>>"Jerry Stuckle" <jstucklex@attg lobal.netwrote in message
                            >>>>>>>news:gf2 t4m$inr$1@regis tered.motzarell a.org...
                            >>>>>>>>Reque st-1 wrote:
                            >>>>>>>>>hi folks,
                            >>>>>>>>>>
                            >>>>>>>>>html coder here, new and terrified * of php!!
                            >>>>>>>>>aaaaaa !
                            >>>>>>>>>>
                            >>>>>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                            >>>>>>>>>conver ted from html to php.
                            >>>>>>>>>the conversion went well, it was to use a php session cookie
                            >>>>>>>>>to stop the repeating of an embedded video file on a per
                            >>>>>>>>>sessio n basis; i amended the php code to display a still pic
                            >>>>>>>>>if the session cookie value was nil.
                            >>>>>>>>>>
                            >>>>>>>>>work ed fine.
                            >>>>>>>>>>
                            >>>>>>>>>though t I'd try integrating a tested and true JS image random
                            >>>>>>>>>rotato r script into the echo command, but the problem was the
                            >>>>>>>>>synt ax of the single quotes and double quotes needed in the
                            >>>>>>>>>doc.wr ite and variable sequences in the JS.
                            >>>>>>>>>>
                            >>>>>>>>>i tried escaping the double quotes (my echo used double
                            >>>>>>>>>quotes ), but to no avail.
                            >>>>>>>>>>
                            >>>>>>>>>here 's the JS CODE i use in the tail end of my PHP.
                            >>>>>>>>>"picnu mber" is the variable holding the randomly assigned
                            >>>>>>>>>numb er that chooses the picture.
                            >>>>>>>>>>
                            >>>>>>>>>any help much appreciated..
                            >>>>>>>>>>
                            >>>>>>>>>>
                            >>>>>>>>>++++++ ++++++++++
                            >>>>>>>>>>
                            >>>>>>>>>{ echo "
                            >>>>>>>>>>
                            >>>>>>>>> <script language='JavaS cript1.2'>
                            >>>>>>>>> <!-- begin
                            >>>>>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                            >>>>>>>>> '.jpg'>\");
                            >>>>>>>>> // end -->
                            >>>>>>>>></script>
                            >>>>>>>>> "; }
                            >>>>>>>>>>
                            >>>>>>>>>++++++ +++++++++++++++ +++++
                            >>>>>>>>>>
                            >>>>>>>>>than ks
                            >>>>>>>>You have an extra single quote before <img ...
                            >>>>>>>Hi Jerry,
                            >>>>>>>>
                            >>>>>>>the single quote is actually necessary in JS when you're using
                            >>>>>>>document .write to add strings in series (is it called
                            >>>>>>>"concate nating" or something?). so the <img src...statement
                            >>>>>>>was broken down into 3 seperate stings to be re-joined - all
                            >>>>>>>within the double-quote nested doc.write stmt. my mistake was
                            >>>>>>>to leave the image path in single quotes; instead I tried
                            >>>>>>>"escap ed double quotes" to complete the image path, like so,
                            >>>>>>>>
                            >>>>>>>{ echo "<script language='JavaS cript1.2'>\n";
                            >>>>>>> echo "<!-- begin \n";
                            >>>>>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                            >>>>>>> +'.jpg\"
                            >>>>>>>width=\" 320\" height=\"240\" border=\"0\" alt=\"Fitness
                            >>>>>>>Traini ng Image\">');\n";
                            >>>>>>> echo "// end -->\n";
                            >>>>>>> echo "</script>"; }
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>>but no avail. still no pic shows up.
                            >>>>>>>>
                            >>>>>>>anyway . i get really confused with all the nested stuff and
                            >>>>>>>single-double quotes. i may try that "heredoc" thing that
                            >>>>>>>Thomas suggested. I'll need a couple of beers first. Friday
                            >>>>>>>night on Javascript? Bad!
                            >>>>>>>>
                            >>>>>>>>
                            >>>>>>BTW - you don't need quotes around numeric values like your
                            >>>>>>width, height and border. Only non-numeric data.
                            >>>>>Are you talking about generating strict (X)HTML? Quotes must be
                            >>>>>on all element attributes in that case, regardless of attribute
                            >>>>>value type.
                            >>>>>>
                            >>>>>>
                            >>>>1. There is no indication this is XHTML.
                            >>>>2. You shouldn't use XHTML for web pages - it's not well supported
                            >>>>by some browser, not the least being IE 6 and 7.
                            >>>Actually, many can and do use XHTML for web pages.
                            >>>>
                            >>>I looked at this page successfully using IE7. The web document was
                            >>>written by NONE OTHER THAN BY THE W3 Consortium itself, the
                            >>>standards- setting (they use the term "recommendation s" modestly
                            >>>instead of "standards" ) in strict XHTML. Go figure.
                            >>>>
                            >>Sure, you CAN make pages which will cater to the different browsers
                            >>idiosyncrasie s, but why? Where is the need for xhtml?
                            >>>
                            >>>There are various documents that can be googled that specify
                            >>>solutions wo using XHTML for broken browsers like Internet
                            >>>Explorer, such as using an XML stylesheet also to get around
                            >>>problems with showing XHTML in standards-violating,
                            >>>never-get-it-right HTTP clients like Internet Explorer. This is
                            >>>not rocket science.
                            >>>>
                            >>>>HTML does NOT require quotes on numeric attributes.
                            >>>Actually the HTML 4 recommendation does not assert in any way
                            >>>whatsoever that quotes can be omitted for attributes that have
                            >>>numeric values. It does allow for their omission, but recommends
                            >>>they always be used. There is no indication about whether this
                            >>>recommendati on applies to the various levels of HTML: strict,
                            >>>transitional , frameset.
                            >>>>
                            >>>http://www.w3.org/TR/html4/intro/sgm...tml#attributes
                            >>>>
                            >>Which backs up my claim that HTML does NOT require quotes on numeric
                            >>attributes.
                            >>
                            >If you really want to split hairs, as you apparently want to do, the
                            >loosest usage of HTML doesn't require quotes on any attribute values
                            >except in the very few circumstances that your determined attempts to
                            >confuse the browser do not achieve the rendering you desire.
                            >>
                            >>>Here is one individual's take on SCRUPULOUSLY quoting all attribute
                            >>>values in HTML, which MUST be quoted in every case in XHTML:
                            >>>>
                            >>>http://www.cs.tut.fi/~jkorpela/qattr.html
                            >>>>
                            >>>He is or was a regular (long-time) and, I believe, respected
                            >>>contribute r to the HTML usage newsgroups.
                            >>So? That's one person's opinion. Worth no more or less than anyone
                            >>else's opinion.
                            >>
                            >Actually, the HTML standards keepers RECOMMEND (though they don't
                            >REQUIRE) you to quote attribute values----ALL OF THEM.
                            >>
                            >But then you have already established that you are a hair-splitter.
                            >>
                            >Perhaps you'd like to disparage the "opinions" of the HTML standards
                            >keepers too?
                            >>
                            >>Search enough and you can find an opinion you agree with anywhere on
                            >>the internet.
                            >>
                            >Precisely right!
                            >>
                            >But then I am not so desperate to support my claims on the sole
                            >"opinion" of one kook with a web page against the 99,999 opinions of
                            >people who impress me with reason and logic and a certain level of
                            >erudition, some of whom actually sit on standards-setting committees
                            >like the one that promulgates the HTML specification.
                            >>
                            >Oh my!
                            >>
                            >A new word of the day:
                            >>
                            > http://www.merriam-webster.com/dictionary/consensus
                            >
                            For starters:
                            >

                            >
                            "Trident layout engine, fully supports HTML 4.01, CSS Level 1, XML 1.0
                            and DOM Level 1, with minor implementation gaps. It partially supports
                            CSS Level 2 and DOM Level 2, with major implementation gaps and
                            conformance issues. Full conformance to the CSS 2.1 specification is
                            on the agenda for the final Internet Explorer 8 release.[32] It has no
                            support for XHTML, though it can render XHTML documents authored with
                            HTML compatibility principles and served with a text/html MIME-type."
                            >
                            And tens of thousands of similar pages.
                            What part of that XHTML page that I gave in the response (inserted here
                            for the readers: http://www.w3.org/MarkUp/2004/xhtml-faq) did not conform
                            to the XHTML specification?? ?

                            Tricking broken browsers---in HTTP response headers, in meta elements,
                            etc.----that don't comply with either the HTML or XHTML specification---
                            notwithstanding your hilarious citation of a Wikipedia article whose
                            content is known to be notoriously inaccurate---is not the fault of page
                            developers. Perhaps instead of recommending that page developers shy away
                            from using XHTML in STARK CONTRAST to the HTML specification writers
                            URGING you to do so, you should be telling them to include alternately
                            served documents with the simple statement urging their readers to stop
                            using broken browsers. Many developers do JUST that, just as many
                            developers that serve script-dependent content tell their readers that the
                            scientific/chemistry calculator they want to use won't work unless they
                            enable their browser to use scripts.

                            And in finishing:

                            Best practices are that attribute values in HTML---all of them---are
                            quoted, as RECOMMENDED by those who promulgated the HTML specificiation.
                            To insist on deviating from best practices is altogether foolish.

                            Comment

                            • Jerry Stuckle

                              #29
                              Re: nesting JS in echo's

                              Seni Seven wrote:
                              Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                              >
                              >Seni Seven wrote:
                              >>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                              >>>
                              >>>Seni Seven wrote:
                              >>>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                              >>>>>
                              >>>>>Seni Seven wrote:
                              >>>>>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                              >>>>>>>
                              >>>>>>>Reques t-1 wrote:
                              >>>>>>>>"Jerr y Stuckle" <jstucklex@attg lobal.netwrote in message
                              >>>>>>>>news:gf 2t4m$inr$1@regi stered.motzarel la.org...
                              >>>>>>>>>Reques t-1 wrote:
                              >>>>>>>>>>hi folks,
                              >>>>>>>>>>>
                              >>>>>>>>>>htm l coder here, new and terrified * of php!!
                              >>>>>>>>>>aaaaa a!
                              >>>>>>>>>>>
                              >>>>>>>>>>i'm trying to bury a JS script to rotate a photo, in a page i
                              >>>>>>>>>>conve rted from html to php.
                              >>>>>>>>>>the conversion went well, it was to use a php session cookie
                              >>>>>>>>>>to stop the repeating of an embedded video file on a per
                              >>>>>>>>>>sessi on basis; i amended the php code to display a still pic
                              >>>>>>>>>>if the session cookie value was nil.
                              >>>>>>>>>>>
                              >>>>>>>>>>worke d fine.
                              >>>>>>>>>>>
                              >>>>>>>>>>thoug ht I'd try integrating a tested and true JS image random
                              >>>>>>>>>>rotat or script into the echo command, but the problem was the
                              >>>>>>>>>>synta x of the single quotes and double quotes needed in the
                              >>>>>>>>>>doc.w rite and variable sequences in the JS.
                              >>>>>>>>>>>
                              >>>>>>>>>>i tried escaping the double quotes (my echo used double
                              >>>>>>>>>>quote s), but to no avail.
                              >>>>>>>>>>>
                              >>>>>>>>>>here' s the JS CODE i use in the tail end of my PHP.
                              >>>>>>>>>>"picn umber" is the variable holding the randomly assigned
                              >>>>>>>>>>numbe r that chooses the picture.
                              >>>>>>>>>>>
                              >>>>>>>>>>any help much appreciated..
                              >>>>>>>>>>>
                              >>>>>>>>>>>
                              >>>>>>>>>>+++++ +++++++++++
                              >>>>>>>>>>>
                              >>>>>>>>>>{ echo "
                              >>>>>>>>>>>
                              >>>>>>>>>> <script language='JavaS cript1.2'>
                              >>>>>>>>>> <!-- begin
                              >>>>>>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                              >>>>>>>>>> '.jpg'>\");
                              >>>>>>>>>> // end -->
                              >>>>>>>>>></script>
                              >>>>>>>>>> "; }
                              >>>>>>>>>>>
                              >>>>>>>>>>+++++ +++++++++++++++ ++++++
                              >>>>>>>>>>>
                              >>>>>>>>>>thank s
                              >>>>>>>>>You have an extra single quote before <img ...
                              >>>>>>>>Hi Jerry,
                              >>>>>>>>>
                              >>>>>>>>the single quote is actually necessary in JS when you're using
                              >>>>>>>>documen t.write to add strings in series (is it called
                              >>>>>>>>"concat enating" or something?). so the <img src...statement
                              >>>>>>>>was broken down into 3 seperate stings to be re-joined - all
                              >>>>>>>>withi n the double-quote nested doc.write stmt. my mistake was
                              >>>>>>>>to leave the image path in single quotes; instead I tried
                              >>>>>>>>"escape d double quotes" to complete the image path, like so,
                              >>>>>>>>>
                              >>>>>>>>{ echo "<script language='JavaS cript1.2'>\n";
                              >>>>>>>> echo "<!-- begin \n";
                              >>>>>>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                              >>>>>>>> +'.jpg\"
                              >>>>>>>>width=\ "320\" height=\"240\" border=\"0\" alt=\"Fitness
                              >>>>>>>>Trainin g Image\">');\n";
                              >>>>>>>> echo "// end -->\n";
                              >>>>>>>> echo "</script>"; }
                              >>>>>>>>>
                              >>>>>>>>>
                              >>>>>>>>but no avail. still no pic shows up.
                              >>>>>>>>>
                              >>>>>>>>anywa y. i get really confused with all the nested stuff and
                              >>>>>>>>singl e-double quotes. i may try that "heredoc" thing that
                              >>>>>>>>Thoma s suggested. I'll need a couple of beers first. Friday
                              >>>>>>>>night on Javascript? Bad!
                              >>>>>>>>>
                              >>>>>>>>>
                              >>>>>>>BTW - you don't need quotes around numeric values like your
                              >>>>>>>width, height and border. Only non-numeric data.
                              >>>>>>Are you talking about generating strict (X)HTML? Quotes must be
                              >>>>>>on all element attributes in that case, regardless of attribute
                              >>>>>>value type.
                              >>>>>>>
                              >>>>>>>
                              >>>>>1. There is no indication this is XHTML.
                              >>>>>2. You shouldn't use XHTML for web pages - it's not well supported
                              >>>>>by some browser, not the least being IE 6 and 7.
                              >>>>Actually, many can and do use XHTML for web pages.
                              >>>>>
                              >>>>I looked at this page successfully using IE7. The web document was
                              >>>>written by NONE OTHER THAN BY THE W3 Consortium itself, the
                              >>>>standards- setting (they use the term "recommendation s" modestly
                              >>>>instead of "standards" ) in strict XHTML. Go figure.
                              >>>>>
                              >>>Sure, you CAN make pages which will cater to the different browsers
                              >>>idiosyncrasi es, but why? Where is the need for xhtml?
                              >>>>
                              >>>>There are various documents that can be googled that specify
                              >>>>solutions wo using XHTML for broken browsers like Internet
                              >>>>Explorer, such as using an XML stylesheet also to get around
                              >>>>problems with showing XHTML in standards-violating,
                              >>>>never-get-it-right HTTP clients like Internet Explorer. This is
                              >>>>not rocket science.
                              >>>>>
                              >>>>>HTML does NOT require quotes on numeric attributes.
                              >>>>Actually the HTML 4 recommendation does not assert in any way
                              >>>>whatsoeve r that quotes can be omitted for attributes that have
                              >>>>numeric values. It does allow for their omission, but recommends
                              >>>>they always be used. There is no indication about whether this
                              >>>>recommendat ion applies to the various levels of HTML: strict,
                              >>>>transitiona l, frameset.
                              >>>>>
                              >>>>http://www.w3.org/TR/html4/intro/sgm...tml#attributes
                              >>>>>
                              >>>Which backs up my claim that HTML does NOT require quotes on numeric
                              >>>attributes .
                              >>If you really want to split hairs, as you apparently want to do, the
                              >>loosest usage of HTML doesn't require quotes on any attribute values
                              >>except in the very few circumstances that your determined attempts to
                              >>confuse the browser do not achieve the rendering you desire.
                              >>>
                              >>>>Here is one individual's take on SCRUPULOUSLY quoting all attribute
                              >>>>values in HTML, which MUST be quoted in every case in XHTML:
                              >>>>>
                              >>>>http://www.cs.tut.fi/~jkorpela/qattr.html
                              >>>>>
                              >>>>He is or was a regular (long-time) and, I believe, respected
                              >>>>contribut er to the HTML usage newsgroups.
                              >>>So? That's one person's opinion. Worth no more or less than anyone
                              >>>else's opinion.
                              >>Actually, the HTML standards keepers RECOMMEND (though they don't
                              >>REQUIRE) you to quote attribute values----ALL OF THEM.
                              >>>
                              >>But then you have already established that you are a hair-splitter.
                              >>>
                              >>Perhaps you'd like to disparage the "opinions" of the HTML standards
                              >>keepers too?
                              >>>
                              >>>Search enough and you can find an opinion you agree with anywhere on
                              >>>the internet.
                              >>Precisely right!
                              >>>
                              >>But then I am not so desperate to support my claims on the sole
                              >>"opinion" of one kook with a web page against the 99,999 opinions of
                              >>people who impress me with reason and logic and a certain level of
                              >>erudition, some of whom actually sit on standards-setting committees
                              >>like the one that promulgates the HTML specification.
                              >>>
                              >>Oh my!
                              >>>
                              >>A new word of the day:
                              >>>
                              >> http://www.merriam-webster.com/dictionary/consensus
                              >For starters:
                              >>
                              >http://en.wikipedia.org/wiki/Internet_Explorer
                              >>
                              >"Trident layout engine, fully supports HTML 4.01, CSS Level 1, XML 1.0
                              >and DOM Level 1, with minor implementation gaps. It partially supports
                              >CSS Level 2 and DOM Level 2, with major implementation gaps and
                              >conformance issues. Full conformance to the CSS 2.1 specification is
                              >on the agenda for the final Internet Explorer 8 release.[32] It has no
                              >support for XHTML, though it can render XHTML documents authored with
                              >HTML compatibility principles and served with a text/html MIME-type."
                              >>
                              >And tens of thousands of similar pages.
                              >
                              What part of that XHTML page that I gave in the response (inserted here
                              for the readers: http://www.w3.org/MarkUp/2004/xhtml-faq) did not conform
                              to the XHTML specification?? ?
                              >
                              Tricking broken browsers---in HTTP response headers, in meta elements,
                              etc.----that don't comply with either the HTML or XHTML specification---
                              notwithstanding your hilarious citation of a Wikipedia article whose
                              content is known to be notoriously inaccurate---is not the fault of page
                              developers. Perhaps instead of recommending that page developers shy away
                              from using XHTML in STARK CONTRAST to the HTML specification writers
                              URGING you to do so, you should be telling them to include alternately
                              served documents with the simple statement urging their readers to stop
                              using broken browsers. Many developers do JUST that, just as many
                              developers that serve script-dependent content tell their readers that the
                              scientific/chemistry calculator they want to use won't work unless they
                              enable their browser to use scripts.
                              >
                              And in finishing:
                              >
                              Best practices are that attribute values in HTML---all of them---are
                              quoted, as RECOMMENDED by those who promulgated the HTML specificiation.
                              To insist on deviating from best practices is altogether foolish.
                              If you find Wikipedia to be inaccurate, you are free to edit it and
                              correct the inaccuracies. That's what it's all about. If you fail to
                              do that, that's your problem.

                              But you also haven't identified exactly WHAT is inaccurate about this
                              article - only made a generic statement. Specifically WHAT is
                              inaccurate, and how are you going to correct it?

                              And I didn't say whether something was recommended or not. I said that
                              quotes were not REQUIRED around numeric values. And they are not.

                              Pages validate quite well with W3C's only HTML validator when numbers
                              are not in quotes. It doesn't even give a warning.

                              --
                              =============== ===
                              Remove the "x" from my email address
                              Jerry Stuckle
                              JDS Computer Training Corp.
                              jstucklex@attgl obal.net
                              =============== ===

                              Comment

                              • Seni Seven

                                #30
                                Re: nesting JS in echo's

                                Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                                Seni Seven wrote:
                                >Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                                >>
                                >>Seni Seven wrote:
                                >>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                                >>>>
                                >>>>Seni Seven wrote:
                                >>>>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                                >>>>>>
                                >>>>>>Seni Seven wrote:
                                >>>>>>>Jerry Stuckle <jstucklex@attg lobal.netwrote in comp.lang.php:
                                >>>>>>>>
                                >>>>>>>>Reque st-1 wrote:
                                >>>>>>>>>"Jer ry Stuckle" <jstucklex@attg lobal.netwrote in message
                                >>>>>>>>>news:g f2t4m$inr$1@reg istered.motzare lla.org...
                                >>>>>>>>>>Reque st-1 wrote:
                                >>>>>>>>>>>hi folks,
                                >>>>>>>>>>>>
                                >>>>>>>>>>>ht ml coder here, new and terrified * of php!!
                                >>>>>>>>>>>aaaa aa!
                                >>>>>>>>>>>>
                                >>>>>>>>>>>i' m trying to bury a JS script to rotate a photo, in a page
                                >>>>>>>>>>>i converted from html to php.
                                >>>>>>>>>>>th e conversion went well, it was to use a php session
                                >>>>>>>>>>>cook ie to stop the repeating of an embedded video file on a
                                >>>>>>>>>>>pe r session basis; i amended the php code to display a
                                >>>>>>>>>>>stil l pic if the session cookie value was nil.
                                >>>>>>>>>>>>
                                >>>>>>>>>>>work ed fine.
                                >>>>>>>>>>>>
                                >>>>>>>>>>>thou ght I'd try integrating a tested and true JS image
                                >>>>>>>>>>>rand om rotator script into the echo command, but the
                                >>>>>>>>>>>prob lem was the syntax of the single quotes and double
                                >>>>>>>>>>>quot es needed in the doc.write and variable sequences in
                                >>>>>>>>>>>th e JS.
                                >>>>>>>>>>>>
                                >>>>>>>>>>>i tried escaping the double quotes (my echo used double
                                >>>>>>>>>>>quot es), but to no avail.
                                >>>>>>>>>>>>
                                >>>>>>>>>>>here 's the JS CODE i use in the tail end of my PHP.
                                >>>>>>>>>>>"pic number" is the variable holding the randomly assigned
                                >>>>>>>>>>>numb er that chooses the picture.
                                >>>>>>>>>>>>
                                >>>>>>>>>>>an y help much appreciated..
                                >>>>>>>>>>>>
                                >>>>>>>>>>>>
                                >>>>>>>>>>>++++ ++++++++++++
                                >>>>>>>>>>>>
                                >>>>>>>>>>>{ echo "
                                >>>>>>>>>>>>
                                >>>>>>>>>>> <script language='JavaS cript1.2'>
                                >>>>>>>>>>> <!-- begin
                                >>>>>>>>>>> document.write( \"'<img src='images/swap/'+ picnumber +
                                >>>>>>>>>>> '.jpg'>\");
                                >>>>>>>>>>> // end -->
                                >>>>>>>>>>></script>
                                >>>>>>>>>>> "; }
                                >>>>>>>>>>>>
                                >>>>>>>>>>>++++ +++++++++++++++ +++++++
                                >>>>>>>>>>>>
                                >>>>>>>>>>>than ks
                                >>>>>>>>>>You have an extra single quote before <img ...
                                >>>>>>>>>Hi Jerry,
                                >>>>>>>>>>
                                >>>>>>>>>the single quote is actually necessary in JS when you're
                                >>>>>>>>>usin g document.write to add strings in series (is it called
                                >>>>>>>>>"conca tenating" or something?). so the <img src...>
                                >>>>>>>>>statem ent was broken down into 3 seperate stings to be
                                >>>>>>>>>re-joined - all within the double-quote nested doc.write
                                >>>>>>>>>stmt . my mistake was to leave the image path in single
                                >>>>>>>>>quotes ; instead I tried "escaped double quotes" to complete
                                >>>>>>>>>the image path, like so,
                                >>>>>>>>>>
                                >>>>>>>>>{ echo "<script language='JavaS cript1.2'>\n";
                                >>>>>>>>> echo "<!-- begin \n";
                                >>>>>>>>> echo "document.write ('<img src=\"images/swap/' + picnumber
                                >>>>>>>>> +'.jpg\"
                                >>>>>>>>>width= \"320\" height=\"240\" border=\"0\" alt=\"Fitness
                                >>>>>>>>>Traini ng Image\">');\n";
                                >>>>>>>>> echo "// end -->\n";
                                >>>>>>>>> echo "</script>"; }
                                >>>>>>>>>>
                                >>>>>>>>>>
                                >>>>>>>>>but no avail. still no pic shows up.
                                >>>>>>>>>>
                                >>>>>>>>>anyway . i get really confused with all the nested stuff and
                                >>>>>>>>>sing le-double quotes. i may try that "heredoc" thing that
                                >>>>>>>>>Thom as suggested. I'll need a couple of beers first.
                                >>>>>>>>>Frid ay night on Javascript? Bad!
                                >>>>>>>>>>
                                >>>>>>>>>>
                                >>>>>>>>BTW - you don't need quotes around numeric values like your
                                >>>>>>>>width , height and border. Only non-numeric data.
                                >>>>>>>Are you talking about generating strict (X)HTML? Quotes must
                                >>>>>>>be on all element attributes in that case, regardless of
                                >>>>>>>attribut e value type.
                                >>>>>>>>
                                >>>>>>>>
                                >>>>>>1. There is no indication this is XHTML.
                                >>>>>>2. You shouldn't use XHTML for web pages - it's not well
                                >>>>>>support ed by some browser, not the least being IE 6 and 7.
                                >>>>>Actually , many can and do use XHTML for web pages.
                                >>>>>>
                                >>>>>I looked at this page successfully using IE7. The web document
                                >>>>>was written by NONE OTHER THAN BY THE W3 Consortium itself, the
                                >>>>>standard s- setting (they use the term "recommendation s" modestly
                                >>>>>instead of "standards" ) in strict XHTML. Go figure.
                                >>>>>>
                                >>>>Sure, you CAN make pages which will cater to the different
                                >>>>browsers idiosyncrasies, but why? Where is the need for xhtml?
                                >>>>>
                                >>>>>There are various documents that can be googled that specify
                                >>>>>solution s wo using XHTML for broken browsers like Internet
                                >>>>>Explorer , such as using an XML stylesheet also to get around
                                >>>>>problems with showing XHTML in standards-violating,
                                >>>>>never-get-it-right HTTP clients like Internet Explorer. This is
                                >>>>>not rocket science.
                                >>>>>>
                                >>>>>>HTML does NOT require quotes on numeric attributes.
                                >>>>>Actually the HTML 4 recommendation does not assert in any way
                                >>>>>whatsoev er that quotes can be omitted for attributes that have
                                >>>>>numeric values. It does allow for their omission, but recommends
                                >>>>>they always be used. There is no indication about whether this
                                >>>>>recommenda tion applies to the various levels of HTML: strict,
                                >>>>>transition al, frameset.
                                >>>>>>
                                >>>>>http://www.w3.org/TR/html4/intro/sgm...tml#attributes
                                >>>>>>
                                >>>>Which backs up my claim that HTML does NOT require quotes on
                                >>>>numeric attributes.
                                >>>If you really want to split hairs, as you apparently want to do,
                                >>>the loosest usage of HTML doesn't require quotes on any attribute
                                >>>values except in the very few circumstances that your determined
                                >>>attempts to confuse the browser do not achieve the rendering you
                                >>>desire.
                                >>>>
                                >>>>>Here is one individual's take on SCRUPULOUSLY quoting all
                                >>>>>attribut e values in HTML, which MUST be quoted in every case in
                                >>>>>XHTML:
                                >>>>>>
                                >>>>>http://www.cs.tut.fi/~jkorpela/qattr.html
                                >>>>>>
                                >>>>>He is or was a regular (long-time) and, I believe, respected
                                >>>>>contribute r to the HTML usage newsgroups.
                                >>>>So? That's one person's opinion. Worth no more or less than
                                >>>>anyone else's opinion.
                                >>>Actually, the HTML standards keepers RECOMMEND (though they don't
                                >>>REQUIRE) you to quote attribute values----ALL OF THEM.
                                >>>>
                                >>>But then you have already established that you are a hair-splitter.
                                >>>>
                                >>>Perhaps you'd like to disparage the "opinions" of the HTML
                                >>>standards keepers too?
                                >>>>
                                >>>>Search enough and you can find an opinion you agree with anywhere
                                >>>>on the internet.
                                >>>Precisely right!
                                >>>>
                                >>>But then I am not so desperate to support my claims on the sole
                                >>>"opinion" of one kook with a web page against the 99,999 opinions
                                >>>of people who impress me with reason and logic and a certain level
                                >>>of erudition, some of whom actually sit on standards-setting
                                >>>committees like the one that promulgates the HTML specification.
                                >>>>
                                >>>Oh my!
                                >>>>
                                >>>A new word of the day:
                                >>>>
                                >>> http://www.merriam-webster.com/dictionary/consensus
                                >>For starters:
                                >>>
                                >>http://en.wikipedia.org/wiki/Internet_Explorer
                                >>>
                                >>"Trident layout engine, fully supports HTML 4.01, CSS Level 1, XML
                                >>1.0 and DOM Level 1, with minor implementation gaps. It partially
                                >>supports CSS Level 2 and DOM Level 2, with major implementation gaps
                                >>and conformance issues. Full conformance to the CSS 2.1
                                >>specificati on is on the agenda for the final Internet Explorer 8
                                >>release.[32] It has no support for XHTML, though it can render XHTML
                                >>documents authored with HTML compatibility principles and served
                                >>with a text/html MIME-type."
                                >>>
                                >>And tens of thousands of similar pages.
                                >>
                                >What part of that XHTML page that I gave in the response (inserted
                                >here for the readers: http://www.w3.org/MarkUp/2004/xhtml-faq) did
                                >not conform to the XHTML specification?? ?
                                >>
                                >Tricking broken browsers---in HTTP response headers, in meta
                                >elements, etc.----that don't comply with either the HTML or XHTML
                                >specificatio n--- notwithstanding your hilarious citation of a
                                >Wikipedia article whose content is known to be notoriously
                                >inaccurate---is not the fault of page developers. Perhaps instead of
                                >recommending that page developers shy away from using XHTML in STARK
                                >CONTRAST to the HTML specification writers URGING you to do so, you
                                >should be telling them to include alternately served documents with
                                >the simple statement urging their readers to stop using broken
                                >browsers. Many developers do JUST that, just as many developers that
                                >serve script-dependent content tell their readers that the
                                >scientific/chemistry calculator they want to use won't work unless
                                >they enable their browser to use scripts.
                                >>
                                >And in finishing:
                                >>
                                >Best practices are that attribute values in HTML---all of them---are
                                >quoted, as RECOMMENDED by those who promulgated the HTML
                                >specificiation . To insist on deviating from best practices is
                                >altogether foolish.
                                >
                                If you find Wikipedia to be inaccurate, you are free to edit it and
                                correct the inaccuracies. That's what it's all about. If you fail to
                                do that, that's your problem.
                                >
                                But you also haven't identified exactly WHAT is inaccurate about this
                                article - only made a generic statement. Specifically WHAT is
                                inaccurate, and how are you going to correct it?
                                >
                                And I didn't say whether something was recommended or not. I said
                                that quotes were not REQUIRED around numeric values. And they are
                                not.
                                >
                                Pages validate quite well with W3C's only HTML validator when numbers
                                are not in quotes. It doesn't even give a warning.
                                Yeah, Transitional HTML is forgiving that way.

                                Set the validator for Strict HTML, and pretty much all of the attributes
                                you would want to use with numeric values are disallowed---that is,
                                generate an error on the validator. You are supposed to be using a
                                styling convention (CSS).

                                Set the validator to use the HTML Tidy option to----in its words---CLEAN
                                UP your HTML, and lo and behold, all your unquoted attribute values---
                                every one of them---get quoted, and your doctype is set to Transitional to
                                allow the otherwise disallowed attributes in Strict HTML.

                                What do you think that W3 is saying to the HTML page writer when it
                                "cleans up" the page this way?

                                Comment

                                Working...