shorttags

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

    shorttags

    I am trying to debug an application that is an intranet app behind a
    firewall accessible only via vpn. The problem I am having is that the
    tables sorting is now working properly in Firefox 2.

    Doing a "view source" only yields the template, as the the page is
    written as a response back from an AJAX call. So, I went to internet
    explorer and did a javascript:docu ment.write(main wapper.innerHTM L). My
    intent was to build a page that was close to what the actual page was by
    doing a "view page" from there and cutting and pasting.

    The problem with this procedure is that it converts things like id="foo"
    to id=foo. Doing a validation with W3C then yields tons of errors
    stating that SHORTTAGS YES needs to be there. Researching how to put it
    in gave me to info to change the doctype. I don't want to do that, as I
    want to keep it "strict" and XHTML.

    How can I get the writing to not strip off the surrounding quotes?

    While we are at it, --- and this may sound simple ---, W3C validation
    with "strict" complains about align="center" for <td>, and about other
    attributes. How can I write these to accomplish the centering and still
    be compliant with the "strict"?
  • Morten Holt

    #2
    Re: shorttags

    sheldonlg wrote:
    I am trying to debug an application that is an intranet app behind a
    firewall accessible only via vpn. The problem I am having is that the
    tables sorting is now working properly in Firefox 2.
    >
    Doing a "view source" only yields the template, as the the page is
    written as a response back from an AJAX call. So, I went to internet
    explorer and did a javascript:docu ment.write(main wapper.innerHTM L). My
    intent was to build a page that was close to what the actual page was by
    doing a "view page" from there and cutting and pasting.
    >
    The problem with this procedure is that it converts things like id="foo"
    to id=foo. Doing a validation with W3C then yields tons of errors
    stating that SHORTTAGS YES needs to be there. Researching how to put it
    in gave me to info to change the doctype. I don't want to do that, as I
    want to keep it "strict" and XHTML.
    >
    How can I get the writing to not strip off the surrounding quotes?
    Did you consider getting the Developer Toolbar extension for Firefox? It
    has a view generated source function. You can then run that through the
    W3C validator.
    >
    While we are at it, --- and this may sound simple ---, W3C validation
    with "strict" complains about align="center" for <td>, and about other
    attributes. How can I write these to accomplish the centering and still
    be compliant with the "strict"?
    I don't know if align is removed in XHTML, but try setting it in the
    stylesheets instead. HTML shouldn't be used for presentation.

    --
    Morten 'T-Hawk' Holt
    In the joy of anticipation there's the anticipatory
    letdown of anticipating not anticipating anticipation
    of some future anticipation.

    Comment

    • sheldonlg

      #3
      Re: shorttags

      Morten Holt wrote:
      sheldonlg wrote:
      >I am trying to debug an application that is an intranet app behind a
      >firewall accessible only via vpn. The problem I am having is that the
      >tables sorting is now working properly in Firefox 2.
      >>
      >Doing a "view source" only yields the template, as the the page is
      >written as a response back from an AJAX call. So, I went to internet
      >explorer and did a javascript:docu ment.write(main wapper.innerHTM L).
      >My intent was to build a page that was close to what the actual page
      >was by doing a "view page" from there and cutting and pasting.
      >>
      >The problem with this procedure is that it converts things like
      >id="foo" to id=foo. Doing a validation with W3C then yields tons of
      >errors stating that SHORTTAGS YES needs to be there. Researching how
      >to put it in gave me to info to change the doctype. I don't want to
      >do that, as I want to keep it "strict" and XHTML.
      >>
      >How can I get the writing to not strip off the surrounding quotes?
      Did you consider getting the Developer Toolbar extension for Firefox? It
      has a view generated source function. You can then run that through the
      W3C validator.
      I have that, but it does other things like optimizing the line. I
      wanted a truer representation.

      >
      >>
      >While we are at it, --- and this may sound simple ---, W3C validation
      >with "strict" complains about align="center" for <td>, and about other
      >attributes. How can I write these to accomplish the centering and
      >still be compliant with the "strict"?
      I don't know if align is removed in XHTML, but try setting it in the
      stylesheets instead. HTML shouldn't be used for presentation.
      What attribute? When I tried style=" and waited for the choices, I
      didn't see align anywhere in there. Which one will align a <td>?
      >

      Comment

      • Morten Holt

        #4
        Re: shorttags

        sheldonlg wrote:
        >>While we are at it, --- and this may sound simple ---, W3C validation
        >>with "strict" complains about align="center" for <td>, and about
        >>other attributes. How can I write these to accomplish the centering
        >>and still be compliant with the "strict"?
        >I don't know if align is removed in XHTML, but try setting it in the
        >stylesheets instead. HTML shouldn't be used for presentation.
        >
        What attribute? When I tried style=" and waited for the choices, I
        didn't see align anywhere in there. Which one will align a <td>?
        The CSS attribute for alignment is text-align. But that's more a CSS,
        than a HTML question. Oh and you should avoid inline styles, if possible.

        --
        Morten 'T-Hawk' Holt
        In the joy of anticipation there's the anticipatory
        letdown of anticipating not anticipating anticipation
        of some future anticipation.

        Comment

        • viza

          #5
          Re: shorttags

          On Wed, 23 Jul 2008 15:42:47 -0400, sheldonlg wrote:
          I am trying to debug an application that is an intranet app behind a
          firewall accessible only via vpn. The problem I am having is that the
          tables sorting is now working properly in Firefox 2.
          "not"?
          Doing a "view source" only yields the template, as the the page is
          written as a response back from an AJAX call.
          So, I went to internet
          explorer and did a javascript:docu ment.write(main wapper.innerHTM L).
          The problem with this procedure is that it converts things like id="foo"
          to id=foo.
          That is valid html.
          ... I want to keep it "strict" and XHTML.
          >
          How can I get the writing to not strip off the surrounding quotes?
          Well if internet explorer is internally converting your xhtml to html,
          then perhaps what you need to debug is the html generated, not the
          intermediate text that your javascript writes.

          Alternatively, does your API (ajax?) provide a method to get the
          generated page before it is passed to the browser? Something like
          innerHTML but that gets called earlier?
          While we are at it, --- and this may sound simple ---, W3C validation
          with "strict" complains about align="center" for <td>, and about other
          attributes. How can I write these to accomplish the centering and still
          be compliant with the "strict"?
          The main difference and reason that strict is preferable to transitional
          is that these attributes are not allowed. You can't "sneak them in" and
          still be valid. You have to use CSS for styling you pages. (Another big
          difference is that frames aren't allowed).

          Also, you seem to think that xhtml is somehow better than html; it
          isn't.

          Comment

          • Stevo

            #6
            Re: shorttags

            Morten Holt wrote:
            sheldonlg wrote:
            >>>While we are at it, --- and this may sound simple ---, W3C
            >>>validation with "strict" complains about align="center" for <td>,
            >>>and about other attributes. How can I write these to accomplish the
            >>>centering and still be compliant with the "strict"?
            >>I don't know if align is removed in XHTML, but try setting it in the
            >>stylesheets instead. HTML shouldn't be used for presentation.
            >>
            >What attribute? When I tried style=" and waited for the choices, I
            >didn't see align anywhere in there. Which one will align a <td>?
            The CSS attribute for alignment is text-align. But that's more a CSS,
            than a HTML question. Oh and you should avoid inline styles, if possible.
            I've found that only IE aligns all elements according to the text-align
            attribute. Firefox and Safari won't align DIVs, OBJECTS or EMBEDS,
            they'll only align text and images.

            I've had to build a workaround to dynamically add the align="center"
            attribute to DIVs that some page designer has used text-align:center and
            expected that my Div would be centered by it, but only IE respects it.
            I'd always thought the page designed was wrong to use it and said they
            should use align="center" instead. My opinion wasn't based on standards,
            just on what works and what doesn't.

            Comment

            • Jonathan N. Little

              #7
              Re: shorttags

              Stevo wrote:
              I've found that only IE aligns all elements according to the text-align
              attribute. Firefox and Safari won't align DIVs, OBJECTS or EMBEDS,
              they'll only align text and images.
              Of course they do! Images are INLINE elements and divs and objects are
              BLOCK elements. "test-align: /whatever/" applies to INLINE elements not
              BLOCK. One of most common questions here, "how to center {insert block
              element of your choice}"

              STEP 1, give element an explicit width(px if it contains a static px
              size content like an image, em to be proportional to textual content, %
              to be proportional to canvas)

              STEP 2, set the left & right MARGINS on the element( "margin-right:
              auto; margin-left-auto;" or set top & bottom also "margin: 0 auto;" or
              set top &bottom to different values "margin: 0 auto 1em auto;"
              >
              I've had to build a workaround to dynamically add the align="center"
              attribute to DIVs that some page designer has used text-align:center and
              expected that my Div would be centered by it, but only IE respects it.
              I'd always thought the page designed was wrong to use it and said they
              should use align="center" instead. My opinion wasn't based on standards,
              just on what works and what doesn't.
              Vintage 1990's solution--try moving into this millennium.

              --
              Take care,

              Jonathan
              -------------------
              LITTLE WORKS STUDIO

              Comment

              • sheldonlg

                #8
                Re: shorttags

                viza wrote:
                On Wed, 23 Jul 2008 15:42:47 -0400, sheldonlg wrote:
                >
                >I am trying to debug an application that is an intranet app behind a
                >firewall accessible only via vpn. The problem I am having is that the
                >tables sorting is now working properly in Firefox 2.
                >
                "not"?
                Typo. Of course it is "not".
                >
                >Doing a "view source" only yields the template, as the the page is
                >written as a response back from an AJAX call.
                >
                >So, I went to internet
                >explorer and did a javascript:docu ment.write(main wapper.innerHTM L).
                >
                >The problem with this procedure is that it converts things like id="foo"
                >to id=foo.
                >
                That is valid html.
                But W3C validation complains.
                >
                >... I want to keep it "strict" and XHTML.
                >>
                >How can I get the writing to not strip off the surrounding quotes?
                >
                Well if internet explorer is internally converting your xhtml to html,
                then perhaps what you need to debug is the html generated, not the
                intermediate text that your javascript writes.
                I want to debug what is actually sent to the browser.
                >
                Alternatively, does your API (ajax?) provide a method to get the
                generated page before it is passed to the browser? Something like
                innerHTML but that gets called earlier?
                Possible. I'll look into that.
                >
                >While we are at it, --- and this may sound simple ---, W3C validation
                >with "strict" complains about align="center" for <td>, and about other
                >attributes. How can I write these to accomplish the centering and still
                >be compliant with the "strict"?
                >
                The main difference and reason that strict is preferable to transitional
                is that these attributes are not allowed. You can't "sneak them in" and
                still be valid. You have to use CSS for styling you pages. (Another big
                difference is that frames aren't allowed).
                I am not trying to "sneak things in". I simply wanted a method to align
                it. I found out what that is and I don't mind putting it into css.
                >
                Also, you seem to think that xhtml is somehow better than html; it
                isn't.
                Not my choice. The template is XHTML and I need to stay with that.

                Comment

                • Stevo

                  #9
                  Re: shorttags

                  Jonathan N. Little wrote:
                  Stevo wrote:
                  >I've found that only IE aligns all elements according to the
                  >text-align attribute. Firefox and Safari won't align DIVs, OBJECTS or
                  >EMBEDS, they'll only align text and images.
                  >
                  Of course they do! Images are INLINE elements and divs and objects are
                  BLOCK elements. "test-align: /whatever/" applies to INLINE elements not
                  BLOCK. One of most common questions here, "how to center {insert block
                  element of your choice}"
                  >
                  STEP 1, give element an explicit width(px if it contains a static px
                  size content like an image, em to be proportional to textual content, %
                  to be proportional to canvas)
                  >
                  STEP 2, set the left & right MARGINS on the element( "margin-right:
                  auto; margin-left-auto;" or set top & bottom also "margin: 0 auto;" or
                  set top &bottom to different values "margin: 0 auto 1em auto;"
                  I just tried that, it works a treat. Thanks a lot.
                  >I've had to build a workaround to dynamically add the align="center"
                  >attribute to DIVs that some page designer has used text-align:center
                  >and expected that my Div would be centered by it, but only IE respects
                  >it. I'd always thought the page designed was wrong to use it and said
                  >they should use align="center" instead. My opinion wasn't based on
                  >standards, just on what works and what doesn't.
                  >
                  Vintage 1990's solution--try moving into this millennium.
                  We're all trying our best to keep up ;-)

                  Comment

                  • Stevo

                    #10
                    Re: shorttags

                    Stevo wrote:
                    Jonathan N. Little wrote:
                    >Stevo wrote:
                    >>I've found that only IE aligns all elements according to the
                    >>text-align attribute. Firefox and Safari won't align DIVs, OBJECTS or
                    >>EMBEDS, they'll only align text and images.
                    >>
                    >Of course they do! Images are INLINE elements and divs and objects are
                    >BLOCK elements. "test-align: /whatever/" applies to INLINE elements
                    >not BLOCK. One of most common questions here, "how to center {insert
                    >block element of your choice}"
                    >>
                    >STEP 2, set the left & right MARGINS on the element( "margin-right:
                    >auto; margin-left-auto;" or set top & bottom also "margin: 0 auto;" or
                    >set top &bottom to different values "margin: 0 auto 1em auto;"
                    >
                    I just tried that, it works a treat. Thanks a lot.
                    I don't actually understand how changing the margin to auto changes it
                    from being a block element to an inline element though. It's still the
                    same element type. If a DIV is a block, then isn't it still a block when
                    it has auto margin? The answer won't change anything for me, it's
                    working great now, but I can't help wondering.

                    Comment

                    • Adrienne Boswell

                      #11
                      Re: shorttags

                      Gazing into my crystal ball I observed Stevo <no@mail.invali dwriting
                      in news:g6a2mc$6jt $02$1@news.t-online.com:
                      Stevo wrote:
                      >Jonathan N. Little wrote:
                      >>Stevo wrote:
                      >>>I've found that only IE aligns all elements according to the
                      >>>text-align attribute. Firefox and Safari won't align DIVs, OBJECTS
                      or
                      >>>EMBEDS, they'll only align text and images.
                      >>>
                      >>Of course they do! Images are INLINE elements and divs and objects
                      are
                      >>BLOCK elements. "test-align: /whatever/" applies to INLINE elements
                      >>not BLOCK. One of most common questions here, "how to center
                      {insert
                      >>block element of your choice}"
                      >>>
                      >>STEP 2, set the left & right MARGINS on the element( "margin-right:
                      >>auto; margin-left-auto;" or set top & bottom also "margin: 0 auto;"
                      or
                      >>set top &bottom to different values "margin: 0 auto 1em auto;"
                      >>
                      >I just tried that, it works a treat. Thanks a lot.
                      >
                      I don't actually understand how changing the margin to auto changes it
                      from being a block element to an inline element though. It's still the
                      same element type. If a DIV is a block, then isn't it still a block
                      when
                      it has auto margin? The answer won't change anything for me, it's
                      working great now, but I can't help wondering.
                      >
                      Declaring margin auto does not change an element from block to inline.
                      Since block elements take up 100% of their containing element, declaring
                      width and/or height constrains it, and thus allowing auto margin to
                      "center" the element.

                      To make a block element inline, one would declare "element
                      {display:inline }" and conversly, "element {display:block} " to make an
                      inline element display as a block element.

                      Comment

                      • Tim Streater

                        #12
                        Re: shorttags

                        In article <29748$48888ea7 $40cba7b7$26986 @NAXS.COM>,
                        "Jonathan N. Little" <lws4art@centra l.netwrote:
                        Stevo wrote:
                        Stevo wrote:
                        Jonathan N. Little wrote:
                        >Stevo wrote:
                        >>I've found that only IE aligns all elements according to the
                        >>text-align attribute. Firefox and Safari won't align DIVs, OBJECTS
                        >>or EMBEDS, they'll only align text and images.
                        >>
                        >Of course they do! Images are INLINE elements and divs and objects
                        >are BLOCK elements. "test-align: /whatever/" applies to INLINE
                        >elements not BLOCK. One of most common questions here, "how to
                        >center {insert block element of your choice}"
                        >>
                        >STEP 2, set the left & right MARGINS on the element( "margin-right:
                        >auto; margin-left-auto;" or set top & bottom also "margin: 0 auto;"
                        >or set top &bottom to different values "margin: 0 auto 1em auto;"
                        >
                        I just tried that, it works a treat. Thanks a lot.
                        I don't actually understand how changing the margin to auto changes it
                        from being a block element to an inline element though.
                        >
                        It doesn't! It remain a block element it just make the margin on the
                        left and right automatically the same. You need to understand what
                        margins are:
                        >
                        http://www.w3.org/TR/CSS21/box.html#box-dimensions
                        Indeed, I would be inclined to start here:



                        and read the lot.

                        Comment

                        • Stevo

                          #13
                          Re: shorttags

                          Tim Streater wrote:
                          In article <29748$48888ea7 $40cba7b7$26986 @NAXS.COM>,
                          "Jonathan N. Little" <lws4art@centra l.netwrote:Indeed, I would be inclined to start here:

                          and read the lot.
                          Oh I'd love to, but I'm hoping my brief foray into CSS has been and gone
                          and doesn't come back ;-) We're in-between CSS gurus where I work,
                          otherwise I wouldn't have had to find out what the deal was here.

                          Thanks again though guys, this rocks :-)

                          Comment

                          • Andy Dingley

                            #14
                            Re: shorttags

                            On 23 Jul, 20:42, sheldonlg <sheldonlgwrote :
                            I am trying to debug an application
                            So post a URL
                            that is an intranet app behind a
                            firewall accessible only via vpn.
                            So post a URL to a copy of it, redacted as necessary.

                            Comment

                            • sheldonlg

                              #15
                              Re: shorttags

                              Andy Dingley wrote:
                              On 23 Jul, 20:42, sheldonlg <sheldonlgwrote :
                              >I am trying to debug an application
                              >
                              So post a URL
                              >
                              >that is an intranet app behind a
                              >firewall accessible only via vpn.
                              >
                              So post a URL to a copy of it, redacted as necessary.
                              I am unable to do that! This is an AJAX app, where the various pages
                              depend upon accessing databased to build the html and then sending it
                              back to be displayed via html. When I simply try to make an app with
                              the final html output, it works properly and I cannot reproduce the error.

                              I fully understand that a URL would be best - but that is impossible in
                              this case. That is why I asked about how to get the javascript
                              document.write to no remove the quotes. I want to try to validate that
                              stuff using the same headers that are used in the real application.
                              Perhaps I can find something in the validation that might get it to work.

                              Again, a URL is impossible to provide and a "copy of it" does not
                              reproduce the problem -- so it is useless.

                              Comment

                              Working...