NJC Posted April 9, 2007 Share Posted April 9, 2007 I did a validation of my XHTML and the validation kept throwing up errors on the following HTML code. What is wrong in this code? <script type="text/javascript" language="javascript1.2">document.write(' <select name="to_lang" onchange="lp=this.options[this.selectedIndex].value; if(lp!=\'\') window.location=\'http://www.google.com/translate?hl=en&ie=UTF-8&oe=UTF-8&u=http://www.notjustcricket.com&langpair=\'+lp;" style="font:11px arial;width:110px" align="center"><option value=\'\'>Select language</option> Link to comment Share on other sites More sharing options...
jlhaslip Posted April 9, 2007 Share Posted April 9, 2007 Place the javascript in an external file and reference it . Link to comment Share on other sites More sharing options...
Fizzix Posted April 9, 2007 Share Posted April 9, 2007 I did a validation of my XHTML and the validation kept throwing up errors on the following HTML code. What is wrong in this code?<script type="text/javascript" language="javascript1.2">document.write(' <select name="to_lang" onchange="lp=this.options[this.selectedIndex].value; if(lp!=\'\') window.location=\'http://www.google.com/translate?hl=en&ie=UTF-8&oe=UTF-8&u=http://www.notjustcricket.com&langpair=\'+lp;" style="font:11px arial;width:110px" align="center"><option value=\'\'>Select language</option> Could it possibly be that the first thing in your code is a less than sign in coding, rather than the code symbol for anglebracket? Example:the code for <, the opening anglebracket on a code in (X)HTML, is < - that is, using < will show an opening anglebracket on your page. Try using the opening anglebracket itself, and see if the validation comes through. Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted April 9, 2007 Share Posted April 9, 2007 Actually, the forum turns it into an angle bracket if you put a <script> tag in because it is a security feature to prevent XSS.Remove the language attribute from the JavaScript tag. Also, see http://htmlhelp.com/tools/validator/problems.html#script Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted April 9, 2007 Share Posted April 9, 2007 Actually, the forum turns it into an angle bracket if you put a <script> tag in because it is a security feature to prevent XSS.Remove the language attribute from the JavaScript tag. Also, see http://htmlhelp.com/tools/validator/problems.html#script Link to comment Share on other sites More sharing options...
Guest FirefoxRocks Posted April 9, 2007 Share Posted April 9, 2007 - Link to comment Share on other sites More sharing options...
Fizzix Posted April 9, 2007 Share Posted April 9, 2007 Actually, the forum turns it into an angle bracket if you put a <script> tag in because it is a security feature to prevent XSS.Remove the language attribute from the JavaScript tag. Also, see http://htmlhelp.com/tools/validator/problems.html#script Sorry, thought it might be a wee bit obvious, but... I tried. Sorry... Link to comment Share on other sites More sharing options...
croatiankid Posted April 10, 2007 Share Posted April 10, 2007 maybe that document.write is not allowed in XHTML?? Link to comment Share on other sites More sharing options...
aspnetguy Posted April 10, 2007 Share Posted April 10, 2007 maybe that document.write is not allowed in XHTML??The validator doesn't look at the javascript code, only HTML tags. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now