html attribute name replaced by character entities
2 posters
Page 1 of 1
html attribute name replaced by character entities
Technical Details
Forum version : #PunBB
Position : Member
Concerned browser(s) : Mozilla Firefox
Who the problem concerns : Yourself
Forum link : ( link is hidden, you must reply to see )
Description of problem
I'm trying to create a post template whose colour changes when hovered over, then reverting when the mouse is not hovered over the element. I am trying to utilise the onmouseover and onmouseout events, however the 'o's keep getting replaced by their character entities, 'o' when the code is viewed via the inspect element developer tool of my browser, and it does not work.for instance,
- Code:
<div style="background:white" onmouseover="this.style.background='black'" onmouseout="this.style.background='white'"></div>
- Code:
<div style="background:white" onmouseover="this.style.background='black'" onmouseout="this.style.background='white'"></div>
I know I can use a style block with hover state selection, however I'd prefer to limit the use of that because I may use the template several times in a thread, and I don't want to slow anybody looking at the thread down, as well as a few other reasons.
thanks,
Re: html attribute name replaced by character entities
Hi @ryou,
Most if not all JavaScript methods in messages are not parsed for your security to protect your forum from XSS attacks. For this, I'd recommend adding a rule to your stylesheet to create the effect, if it's going to be used numerous times that is. For example :
Add the following to your stylesheet :
Then you can use it in posts without problem, as long as you use the correct class.
If you're going to use multiple colors, then you'll most likely need to use multiple classes or create an inline stylesheet.
Most if not all JavaScript methods in messages are not parsed for your security to protect your forum from XSS attacks. For this, I'd recommend adding a rule to your stylesheet to create the effect, if it's going to be used numerous times that is. For example :
Add the following to your stylesheet :
- Code:
.tmp-background {
background:#FFF;
}
.tmp-background:hover {
background:#000;
}
Then you can use it in posts without problem, as long as you use the correct class.
- Code:
<div class="tmp-background"></div>
If you're going to use multiple colors, then you'll most likely need to use multiple classes or create an inline stylesheet.
Re: html attribute name replaced by character entities
Oh okay, thanks.
I'm just a member on the forum I am using the template on, so I guess I'll opt for a non-changing background color
I guess this is solved
I'm just a member on the forum I am using the template on, so I guess I'll opt for a non-changing background color
I guess this is solved
Re: html attribute name replaced by character entities
No problem. It is unfortunate, because we've no way to disable this, but it's for the best as anything can happen if everyone can use JavaScript in their posts.
Topic archived
Have a good day. ^^
Topic archived
Have a good day. ^^
Similar topics
» Character Sheet HTML; moving menu under the body
» Character Sheet HTML; moving menu under the body
» The <img> alt Attribute not displaying.
» Add replaced by a notice.
» Templates randomly not loading
» Character Sheet HTML; moving menu under the body
» The <img> alt Attribute not displaying.
» Add replaced by a notice.
» Templates randomly not loading
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum