Kom ihåg mig?
Home Menu

Menu


Städar upp min kod

 
Ämnesverktyg Visningsalternativ
Oläst 2006-10-06, 11:37 #21
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Citat:
Originally posted by cezar@Oct 6 2006, 11:02
Ser ni något big misstake med denna kodsnutt?
Får i allafall en massa errors.

Citat:

<input *type="image" src="http://www.johnny.nu/blog/images/comment.gif" name="submit" />
<input *type=checkbox name=CNremember *id=CNremember value=1><label for=CNremember> Remember Me</label> |
Forget Me
En input har enkelavslut enligt XHTML-specfikation: /> och en har det inte. Vilken dokumenttp validerar du mot?
Kaffe är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-06, 11:50 #22
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
Citat:
Ursprungligen postat av Kaffe
Citat:
Ursprungligen postat av cezar
Ser ni något big misstake med denna kodsnutt?
Får i allafall en massa errors.

Citat:

<input *type="image" src="http://www.johnny.nu/blog/images/comment.gif" name="submit" />
<input *type=checkbox name=CNremember *id=CNremember value=1><label for=CNremember> Remember Me</label> |
Forget Me


En input har enkelavslut enligt XHTML-specfikation: /> och en har det inte. Vilken dokumenttp validerar du mot?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
cezar är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-06, 11:55 #23
f_b f_b är inte uppkopplad
Medlem
 
Reg.datum: Feb 2006
Inlägg: 54
f_b f_b är inte uppkopplad
Medlem
 
Reg.datum: Feb 2006
Inlägg: 54
Du har inget id i den övre raden.
Sen har du inga fnuttar kring värdena till type, name, id,value och for-attributen på rad 2.

Det är de felen jag kan se på rak arm.
f_b är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-09, 11:11 #24
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
Det jobbiga nu är att jag hittar inte koden som jag måste ändra.

Kör med cutenews php script och man ändrar koden i cutenews webgränssnitt som man loggar in på.
Den koden har jag kollat igenom och hittar inte de kodsnuttar som den klagar på.

Citat:

Below are the results of checking this document for XML well-formedness and validity.
Error Line 98 column 69: there is no attribute "name".
...="return CNSubmitComment()" method="post" name="comment" id="comment" action="">


You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.


Error Line 98 column 106: document type does not allow element "br" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
..."comment" id="comment" action="">


The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "

" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


Error Line 128 column 18: character data is not allowed here.
<noscript>Your browser is not Javascript enable or you have turn it off.

You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a

aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).


Error Line 138 column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
<input type=checkbox id="CNremember" value="1" /><label for="CNremember"> Remem


Error Line 147 column 111: required attribute "type" not specified.
...utenews/remember.js"></script><script>CNreadCookie();</script><div style="mar

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
cezar är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-11, 09:21 #25
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
Nu börjar det dra ihop sig, behöver lite hjälp till.

I en show.inc.php fil så finns denna kod som genererar ett jscript:

Kod:
 $CN_remember_include = "<script type=\"text/javascript\" src=\"$config_http_script_dir/remember.js\"></script><script>CNreadCookie();</script>";
      $CN_remember_form = "onsubmit=\"return CNSubmitComment()\"";
Nu så validerar den inte riktigt och jag vågar inte ändra hur som helst.
Som jag fattar det så behöver den typ="text/javascript" som redan finns ?!

<script type=\"text/javascript\" ...

Kod:
Error Line 165, column 96: required attribute "type" not specified . 
...utenews/remember.js"></script><script>CNreadCookie();</script><div style="mar

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element. 

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
cezar är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-11, 09:31 #26
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Det följer ett litet script-block efter det första, som behöver det attributet.

Titta noga så ser du det.
Kaffe är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-11, 11:54 #27
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
Citat:
Originally posted by Kaffe@Oct 11 2006, 09:31
Det följer ett litet script-block efter det första, som behöver det attributet.

Titta noga så ser du det.
Sådär ja.

Nu är det bara <form onsubmit="return CNSubmitComment()" method="post" name="comment" id="comment" action=""> kvar som jag varken hittar i cutenews/inc/show.inc.php eller i cutenews panelen.

Behöver nästan något sökverktyg som söker igenom alla dokument på servern efter just den koden.
Har lagt till ett inlägg på cutenews forum också för den delen...
cezar är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-11, 12:16 #28
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Sökverktyg för att leta igenom koden låter lite overkill gentemot att faktiskt lära sig sin kod .

Skämt åsido, Dreamweaver (som exempel) kan söka igenom alla filer i ett projekt. Säkerligen borde andra editorer med projekthantering klara av det också.
Kaffe är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-11, 14:14 #29
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
cezar cezar är inte uppkopplad
Medlem
 
Reg.datum: Apr 2006
Inlägg: 260
Citat:
Originally posted by Kaffe@Oct 11 2006, 12:16
Sökverktyg för att leta igenom koden låter lite overkill gentemot att faktiskt lära sig sin kod .

Skämt åsido, Dreamweaver (som exempel) kan söka igenom alla filer i ett projekt. Säkerligen borde andra editorer med projekthantering klara av det också.
Ok.
Lite konstigt att den genererar en kod som inte finns med i det jag har skrivit.
Måste komma från någon fil och man kan inte se vilka filer som är include:at.

Cutenews är för övrigt ett ganska stort script och det är svårt att veta vilka filer som gör vad alltid.
cezar är inte uppkopplad   Svara med citatSvara med citat
Oläst 2006-10-12, 08:42 #30
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Citat:
Ursprungligen postat av cezar
Citat:
Ursprungligen postat av Kaffe
Sökverktyg för att leta igenom koden låter lite overkill gentemot att faktiskt lära sig sin kod .

Skämt åsido, Dreamweaver (som exempel) kan söka igenom alla filer i ett projekt. Säkerligen borde andra editorer med projekthantering klara av det också.
Ok.
Lite konstigt att den genererar en kod som inte finns med i det jag har skrivit.
Måste komma från någon fil och man kan inte se vilka filer som är include:at.

Cutenews är för övrigt ett ganska stort script och det är svårt att veta vilka filer som gör vad alltid.
Jag är säker på att kodsnutten finns med, PHP är inte ett ramverk som har förmågan att skriva ut kod på måfå, till skillnad från .NET som gärna skriver ut lite kod här och var.

Jag skulle misstänka, om det inte ligger bland eventuella templates att det renderas utifrån scriptet.

Jag tog en titt i CuteNews, och i shows.inc.php på rad 588 samt 604 hittade jag de relaterade kodbitarna.

Vad exakt är det som inte validerar?
Kaffe är inte uppkopplad   Svara med citatSvara med citat
Svara


Aktiva användare som för närvarande tittar på det här ämnet: 1 (0 medlemmar och 1 gäster)
 

Regler för att posta
Du får inte posta nya ämnen
Du får inte posta svar
Du får inte posta bifogade filer
Du får inte redigera dina inlägg

BB-kod är
Smilies är
[IMG]-kod är
HTML-kod är av

Forumhopp


Alla tider är GMT +2. Klockan är nu 18:25.

Programvara från: vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Svensk översättning av: Anders Pettersson
 
Copyright © 2017