Needs review
Project:
jRating
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
27 May 2007 at 22:31 UTC
Updated:
25 Feb 2010 at 18:00 UTC
Jump to comment: Most recent file
There should be no XHTML validation errors like Error: document type does not allow element "style" here.
<noscript><style type="text/css">form.rating{ display: block; }</style></noscript></body>
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | jrating.patch | 670 bytes | smitty |
| #12 | Validation-output.jpg | 107.06 KB | smitty |
Comments
Comment #1
hass commentedadditional this tag is added independently of a voting box is displayed or not, what makes no sense. only add this code if the voting box is added to the page.
Comment #2
hickory commentedIt's added by jrating_footer: is there a way to tell whether a rating widget has been added to the page in hook_footer? Could look in the array of files added by drupal_add_js, perhaps...
I can't think of a better way to display the block when javascript is disabled, so it'll have to be invalid XHTML for now.
Comment #3
hass commentedi'm sure it is possible - i will try to find a solution next week and provide a patch if found.
For me the current module cannot be used, while i advertise my 20 themes as 100% error and warning free XHTML complicant code and i cannot break with this... no way.
Comment #4
hass commentedtake a look to fivestar rating, please. they solved this well in the following way:
So you should change jratings code to display the selectbox everytime and if JS is enabled it will hide... and XHTML code will be valid.
Comment #5
hickory commentedI'll give that a try, but I'm not sure whether it'll work fast enough to hide the form before it's displayed...
Comment #6
momper commentedhello
is there something new?
thanks and greetings
momper
Comment #7
hickory commentedComment #8
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #9
smitty commentedI am running the Version of 2007-Dec-04 ant get se same validation error from http://validator.w3.org/check: document type does not allow element "style" here.
The code in HTML-Page is in the header:
$("head").append("form.rating{display:none}"); if ($.browser.safari){ $("head").find("style:last").append(" ") }Please help!
Comment #10
hickory commentedsmitty: do you have a page I can look at with this problem?
Comment #11
smitty commented@hickory: I sent you an e-mail this morning.
Comment #12
smitty commentedI replaced the the jrating.module with the one of the version 2007-Nov-23.
There I do not get a validation error.
So it must have something to do with:
putting
into the html-header. Please have a look at the validation output in the attachment.
Comment #13
hickory commentedYou can ignore that, it's a bug in the validator.
Comment #14
smitty commentedThanks’ for this information. Is this bug documented anywhere? Will this be fixed in the validator?
I tried some other validators. But every validator I found via Google showed the same validation message.
Do you know a validator which works properly?
Comment #15
hickory commentedJust ignore it, it really doesn't matter.
Comment #16
smitty commentedSorry, I really don't want to bother you. I'm only looking for an explanation for my customers, who expect a 100% error-free site.
Comment #17
hickory commentedYou should file a bug report with the validator, in that case.
Comment #18
smitty commentedI posted this problem on the w3-validator-mailing-list: http://lists.w3.org/Archives/Public/www-validator/2008Feb/0036.html
Here is a summary what I got back:
- The sript is ok.
- The validator is ok.
- The problem is the validation of the script inside an HTML file.
E.g. Rui del-Negro wrote:
So, why don't you create a function (e.g. in the "jrating.js") and execute that function to get the work done?
Comment #19
hickory commentedI'm sure there was a reason why it was set up this way, but can't remember what it was any more, so maybe it should move into jrating.js.
Comment #20
smitty commentedAccording to the hints in http://javascript.about.com/library/blxhtml.htm I inserted some comment-syntax and now the parser errors are gone.
Please have a look at the attached patch.