|
![]() |
# 1 |
חבר בקהילה
|
"there is no attribute "onload
אני משתמש ב- onload כדי לזמן פונקציה מסויימת מקובץ javascript
כשאני בודק את הדף ב w3c validator אני מקבל רק error אחד. קוד:
there is no attribute "onload". 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. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash. לא מצאתי דרך לפתור את זה, אני צריך את עזרתכם :/ יש אולי איזה דרך לשלב את זה בדרך אחרת ולא עם onload? |
![]() |
![]() |
# 2 | |
הנהלת הפורום לשעבר
|
ציטוט:
אם זה על body, אז אין לי מושג.. אם זה לא...אז נראה לי שמותר לשים את זה רק על body |
|
![]() |
![]() |
# 3 | |
חבר בקהילה
|
ציטוט:
אבל איך אני יכול לפתור את זה שזה עדיין יעשה את הפעולה שאני רוצה ושזה יעבור את הבדיקה? אפשר אולי איכשהו לשלב כזה דבר ב-css או משהו כזה? |
|
![]() |
![]() |
# 4 |
משתמש - היכל התהילה
|
למה ה onload מחכה?
שהתמונה תטען?
__________________
קו ישר, כי אפשר גם אחרת |
![]() |
![]() |
# 5 |
A Al Alm Almo Almog!
תודה על תרומתך! |
אם זו פונקציה שהשימוש בה הוא רק בonload יש דרך לעשות את זה ב JS.
אתה כותב: PHP קוד:
וזה כמובן נימצא בין תגי JS. |
![]() |
![]() |
# 6 |
חבר בקהילה
|
כן, זה סקריפט שבמידה והתמונה חורגת מהגדלים שאני קובע זה מקטין אותה ורק אם לוחצים עליה קליק בעכבר היא נפתחת לגודל הרגיל שלה, ואם לוחצים שוב זה מקטין אותה שוב.
נו ובמידה וזה בין תגי javascript.. איך זה יכול להשפיע על תמונה ספציפית? ממש לא הבנתי את הרעיון :/ |
![]() |
![]() |
# 7 |
חבר וותיק
|
עם ID..
__________________
בברכה עובד, מפתח אתרים. |
![]() |
![]() |
# 8 |
חבר בקהילה
|
ניסיתי ולא הלך לי.
ניסיתי לעשות את זה ככה: קוד:
<script language='JavaScript' type='text/javascript' src='script.js'> <!-- onload=function sizecap() { imageSizeCap(this, 800, 800); } //--> </script> וב-img עשיתי משהו כמו זה: קוד:
<img src="pic.jpg" id="sizecap" /> |
![]() |
![]() |
# 9 |
חבר וותיק
|
HTML קוד:
<script language='JavaScript' type='text/javascript' src='script.js'> <!-- document.getElementById('sizecap').onload=function(){ imageSizeCap(this, 800, 800); } //--> </script> |
![]() |
![]() |
# 10 |
חבר בקהילה
|
תודה רבה על הניסיון, אבל לצערי גם זה לא פועל.
|
![]() |
![]() |
חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים) | |
כלים לאשכול | |
תצורת הצגה | |
|
|