We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7045
    • 225 Posts
    Now I am pissed. My first modx site was finally validating, and then out of nowhere I have 14 errors without changing a bit of code. I noticed that the w3c appears to have had an update, at least the site looks different. Maybe this has something to do with it? The errors seem to stem from the WebLogin. More specifically, from the dynamically generated javascript. Does anybody have any ideas? Here is the link to my site... http://www.smilingdoug.com/cms_version/

    Any help is much appreciated
      • 7045
      • 225 Posts
      Last try, anybody have any suggestions?
        • 27708 MODX Staff
        • 2,502 Posts
        Have you used any editors with Tidy installed. The W3C validator has some limits. You might ask them if there were changes to the way they parse.

        Read the code just before the errors to see if there is a misplaced closing tag etc.

          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
          • 26435
          • 1,193 Posts
          I had the same problem
          I took out all the inline javascript code from the files in /assets/snippets/weblogin/ and put them in an external .js file, then included that file in the head of my template.

          I am working on a snippet based on weblogin. it will be called "WebLoginPE" (PE for progressively enhanced). This snippet will handle the creation and destruction of web user sessions, but will be fully functional without javascript. it will be templatable using chunks and will have built in support for taconite. The examples that I plan on distributing with this will be based on the jQuery taconite plugin which allows an asynchronous post to the server to validate the user and start a session (log them in) and then dynamically update several parts of the page, such as the Wayfinder menu, the placeholder of the login form, perhaps inserting a form to post comments, etc... all without refreshing the page.

          Of course, being progressively enhanced by CSS and javascript, the only thing that would break XHTML 1.1 validation would be something the user adds in a chunk.

          It will require PHP 5 and will be object oriented code.

          I will release this as free open source software, in case you were wondering.

          -sD-
          Dr. Scotty Delicious, Scientist.
            Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
            All of the above... in no specific order.


            I send pointless little messages
            • 7045
            • 225 Posts
            Thanks for the help guys. I can’t wait for your new snippet Doc. It sounds like it is going to be a great replacement for the WebLogin. I will give your suggestion about the javascript a shot.
              • 7045
              • 225 Posts
              Hey Scotty,

              I did what you suggested. I pulled the js out of the file and placed it in an external file. I placed that file into the weblogin folder. I then placed the correct code in the head of the template. I now validate strict, and the login seems to work. I do have have two issues. First, everything is fine in firefox, but now in ie there is a flicker every time I click a button. Another words, the whole screen goes black for a split second after clicking on a button. You can see what I mean here... www.smilingdoug.com/cms_version. This problem only happens when I add the js code to the head. Second problem, and maybe I am just really tired, but aren’t I missing a step. The last thing you said was to include the file in the head. Anyhow, thanks so much for the help Scotty.
                • 26435
                • 1,193 Posts
                hey deniro.
                For problem one: I don’t have any PC’s that have IE on them (only Macs and Linux boxes in my crime lab), so I can’t recreate the "flashing", but it does look good on Safari, FF Mac, Camino, Opera, Ice Weasel, and Konqueror.

                For problem two: Are you missing a step? I don’t think so. The validation errors are caused by the validation engine trying to parse the javascript as XHTML (It should technically be in <![CDATA[ ]]> tags, but it is much better to put the javascript code into an external file and use a src="file.js" attribute in your <script></script> tags. In a true XHTML document, the <a href="#"> tags with the onclick attributes would be out of the question, they would have actual links to pages like login.html?action=login and if JavaScript is enabled, DOM scripting would replace those tags or have them return false for enhanced features like ajax login or dynamic password hinting.

                But that is what I am working on. To be continued....

                -sD-
                Dr. Scotty Delicious, Scientist.
                  Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                  All of the above... in no specific order.


                  I send pointless little messages
                  • 7045
                  • 225 Posts
                  Hey Scotty,

                  Thanks for taking the time to check it out in all the browsers. I agree with you on the linux/mac thing, but unfortunately way too many idiots use ie. Which means I need to make sure my sites work in it, which takes forever. To fix my problem, I just went ahead and put the js back in the original file with the CDATA tags. Everything works great and validates. I will just wait for your snippet to be released and replace the whole thing. Quick question, do you know a way to test a site with Safari in windows or linux?

                  Thanks again Doc
                    • 26435
                    • 1,193 Posts
                    Your best bet right now for getting a screen shot on Safari if you don’t have a mac / have a friend with a mac is http://browsershots.org/. It can be hit or miss as it is still in "beta" (as it has been for the last two years), but it is a great service when the servers aren’t too busy to grab a screen shot for you. I use it all the time to test my CSS layouts in IE. I guess it won’t do much good if you are trying to test function, but you (and anyone here, for that matter) can feel free to hit me up with a private message with a URL and I will grab a screen shot and test in Safari for you. A lot of people on the forums use Macs and most of them would also be more than happy to test for anybody.

                    ***EDIT***
                    BTW, I got a chance to put some heavy work into the WebLoginPE snippet. It is coming along really well. Calling it now gives a perfectly functional login form that will log a user in and/or out without any javascript or inline styles. It also lets the user provide their own form in a chunk. I am working on the asynchronous javascript login right now (yeah it is late!) which will simply use javascript to hijack the same form and submit it via AJAX (actually AHAH) and using Taconite (a framework that dynamically updates the DOM without using the "innerHTML" property). It is so cool because it allows multiple DOM elements to be updated with a single call! Think about updating the menu, the sidebar with special webuser options, and the content area where the login form was with one seamless call... without refreshing the page! I decided to Hijack the form rather than providing a new form with inline javascript. That way, if javascript is turned of or is unsupported, it works as expected, just not as slick.

                    The jQuery Taconite Plugin.

                    -sD-
                    Dr. Scotty Delicious, Scientist.
                      Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
                      All of the above... in no specific order.


                      I send pointless little messages
                      • 17802
                      • 190 Posts
                      Hey Scotty,

                      All of this sounds just great, I’m looking forward to seeing your snippet! grin
                        Thanks for MODx - I love it!