Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript]Błąd validatora, dlaczego?
lamcpp
post
Post #1





Grupa: Zarejestrowani
Postów: 372
Pomógł: 2
Dołączył: 10.05.2009

Ostrzeżenie: (0%)
-----


Sprawdzam poprawność strony w validatorze:
http://validator.w3.org

  1. <script type="text/javascript">
  2. $(document).ready(function(){
  3. $('a[href="#"]').click(function(){
  4. $('#tags').attr('innerHTML','<div class="loading"></div>');
  5. $('#tags').load('index.php?action=tags&id='+$(this).attr('id'));
  6. return false;
  7. });
  8. });
  9. </script>


Pojawia się błąd:
Cytat
Line 197, Column 65: document type does not allow element "div" here
$('#tags').attr('innerHTML','<div class="loading"></div>');

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).


Pytanie, jak temu zaradzić? Czy dobrze rozumiem, ze w elemencie a nie moze byc elementu div? Jak to zamienic?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
-Gość-
post
Post #2





Goście







Czy nikt nie wie?
Go to the top of the page
+Quote Post
PrinceOfPersia
post
Post #3





Grupa: Zarejestrowani
Postów: 717
Pomógł: 120
Dołączył: 18.04.2009

Ostrzeżenie: (0%)
-----


a tez masz podobny problem jak ten uzytkownik (temat zalozony rok temu w koncu...)?
przypuszczam, ze nalezaloby przeniesc kod do oddzielnego pliku *.js, bo zapewne parser probuje sparsowac bracketsy (< oraz >) .

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 17:46