Jump to content
xisto Community
toby

Xhtml Js Loading.

Recommended Posts

<body onload="init()" onresize="gotopos(disptop, displeft)"><img src="" id="mapimg" onload="void(imgload=true);void(sstatus('Map loaded successfully'))" alt=""/>

As Xhtml 1.1, the resize of body, and onload of img are the only errors. How could I do this? All I could think was the onload at the end of the page, but as the image is 1.5mb, I doubt this will work for most people. Btw, the empty src is correct, if you're intrested its the RS world map.

Share this post


Link to post
Share on other sites

If you are using XHTML 1.1, your images need to be in a block-level element, so put <div> around it. Also, XHTML 1.1 needs to be sent with a MIME type of application/xhtml+xml.

Share this post


Link to post
Share on other sites

<body onload="init()" onresize="gotopos(disptop, displeft)"><img src="" id="mapimg" onload="void(imgload=true);void(sstatus('Map loaded successfully'))" alt=""/>
As Xhtml 1.1, the resize of body, and onload of img are the only errors. How could I do this? All I could think was the onload at the end of the page, but as the image is 1.5mb, I doubt this will work for most people. Btw, the empty src is correct, if you're intrested its the RS world map.

What did you call in the init() function? Is the error originate from there? Did you try in another browser?

Share this post


Link to post
Share on other sites

The <img> works, the init() works, the invalidation is the on resize of body, and onload of img.

What error message did you get?

Share this post


Link to post
Share on other sites

Apparently I am receiving the same error when trying to reproduce the problem:

# Line 6, Column 31: there is no attribute "onresize".
<body onload="init()" onresize="gotopos(disptop, displeft)">

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.


# Error Line 7, Column 36: there is no attribute "onload".

<div><img src="" id="mapimg" onload="void(imgload=true);void(sstatus('Map loaded

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.


I would seriously recommend using XHTML 1.0 Strict instead of XHTML 1.1, because of the depreciated lang attribute and MIME type issue. I didn't know they removed the event attributes in XHTML 1.1, can't find any info on that.

Share this post


Link to post
Share on other sites

I havn't got round to adding it, but I've got the lang, charset and mime type correcting code for 1.1. It's just js thats unknown for me. Thanks for trying, weird that its phased out.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.