הרשם שאלות ותשובות רשימת חברים לוח שנה חיפוש הודעות מהיום סמן פורומים כנקראו

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 25-10-07, 02:29   # 1
rsl
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jan 2007
הודעות: 60

rsl לא מחובר  

"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.
בניתי את הדף כ: XHTML 1.0 Transitional
לא מצאתי דרך לפתור את זה, אני צריך את עזרתכם :/
יש אולי איזה דרך לשלב את זה בדרך אחרת ולא עם onload?
  Reply With Quote
ישן 25-10-07, 02:53   # 2
meshuga
הנהלת הפורום לשעבר
 
meshuga's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 35
הודעות: 7,601

meshuga לא מחובר  

ציטוט:
נכתב במקור על ידי rsl צפה בהודעה
אני משתמש ב- 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.
בניתי את הדף כ: XHTML 1.0 Transitional
לא מצאתי דרך לפתור את זה, אני צריך את עזרתכם :/
יש אולי איזה דרך לשלב את זה בדרך אחרת ולא עם onload?
על איזה תג שמת את זה?
אם זה על body, אז אין לי מושג..
אם זה לא...אז נראה לי שמותר לשים את זה רק על body
  Reply With Quote
ישן 25-10-07, 13:24   # 3
rsl
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jan 2007
הודעות: 60

rsl לא מחובר  

ציטוט:
נכתב במקור על ידי meshuga צפה בהודעה
על איזה תג שמת את זה?
אם זה על body, אז אין לי מושג..
אם זה לא...אז נראה לי שמותר לשים את זה רק על body
שמתי את זה על img ... כנראה שזה לא מותר
אבל איך אני יכול לפתור את זה שזה עדיין יעשה את הפעולה שאני רוצה ושזה יעבור את הבדיקה?
אפשר אולי איכשהו לשלב כזה דבר ב-css או משהו כזה?
  Reply With Quote
ישן 25-10-07, 13:39   # 4
בניה
משתמש - היכל התהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: נחושה
הודעות: 3,434

בניה לא מחובר  

למה ה onload מחכה?
שהתמונה תטען?
  Reply With Quote
ישן 25-10-07, 15:53   # 5
somebody
A Al Alm Almo Almog!
תודה על תרומתך!
 
somebody's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: hadera CiTy
גיל: 35
הודעות: 4,005
שלח הודעה באמצעות MSN אל somebody

somebody לא מחובר  

אם זו פונקציה שהשימוש בה הוא רק בonload יש דרך לעשות את זה ב JS.
אתה כותב:

PHP קוד:
onload=function()
{
הפונקציה

וזה כמובן נימצא בין תגי JS.
__________________
דוא"ל: almog.zimel ב ג'מייל נקודה קום
מסנג'ר: almog שטרודל freetopsite נקודה co נקודה il

  Reply With Quote
ישן 26-10-07, 18:53   # 6
rsl
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jan 2007
הודעות: 60

rsl לא מחובר  

ציטוט:
נכתב במקור על ידי בניה צפה בהודעה
למה ה onload מחכה?
שהתמונה תטען?
כן, זה סקריפט שבמידה והתמונה חורגת מהגדלים שאני קובע זה מקטין אותה ורק אם לוחצים עליה קליק בעכבר היא נפתחת לגודל הרגיל שלה, ואם לוחצים שוב זה מקטין אותה שוב.

ציטוט:
נכתב במקור על ידי somebody צפה בהודעה
אם זו פונקציה שהשימוש בה הוא רק בonload יש דרך לעשות את זה ב JS.
אתה כותב:

PHP קוד:
onload=function()
{
&
#1492;פונקציה

וזה כמובן נימצא בין תגי JS.
נו ובמידה וזה בין תגי javascript.. איך זה יכול להשפיע על תמונה ספציפית? ממש לא הבנתי את הרעיון :/
  Reply With Quote
ישן 26-10-07, 19:45   # 7
O-B
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: בבית
גיל: 36
הודעות: 1,423
שלח הודעה באמצעות ICO אל O-B

O-B לא מחובר  

עם ID..
__________________
בברכה עובד, מפתח אתרים.
  Reply With Quote
ישן 26-10-07, 20:25   # 8
rsl
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jan 2007
הודעות: 60

rsl לא מחובר  

ניסיתי ולא הלך לי.

ניסיתי לעשות את זה ככה:
קוד:
<script language='JavaScript' type='text/javascript' src='script.js'>
<!--
onload=function sizecap() {
imageSizeCap(this, 800, 800);
}
//-->
</script>
זה ב-HEAD

וב-img עשיתי משהו כמו זה:
קוד:
<img src="pic.jpg" id="sizecap" />
וזה לא עבד לי ... פשוט לא טען את התמונה.
  Reply With Quote
ישן 26-10-07, 20:53   # 9
חיים
חבר וותיק
 
חיים's Avatar
 
מיני פרופיל
תאריך הצטרפות: Sep 2006
מיקום: עפולה
גיל: 32
הודעות: 1,548
שלח הודעה באמצעות ICO אל חיים שלח הודעה באמצעות MSN אל חיים Send a message via Skype™ to חיים

חיים לא מחובר  

HTML קוד:
<script language='JavaScript' type='text/javascript' src='script.js'>
<!--
document.getElementById('sizecap').onload=function(){
imageSizeCap(this, 800, 800);
}
//-->
</script>
__________________
בברכה, חיים.

  Reply With Quote
ישן 26-10-07, 21:06   # 10
rsl
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jan 2007
הודעות: 60

rsl לא מחובר  

תודה רבה על הניסיון, אבל לצערי גם זה לא פועל.
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 

כלים לאשכול
תצורת הצגה

חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 01:22.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ