PlexPedia Development
Home > Content > Document: Html Compatibilities two
Html Compatibilities two
2 Comments - 12817 Views
More detail.. More problems..... Even a theory on what is wrong!
Submitted By flyclub on 09/04/25
PlexPedia Development, flyclub, Documents 

 
 
The Pre Note
 
Ok, recently (as I have been delving deeper into HTML and JavaScript) I have run into many HTML compatibilities.
 
 
Later on I will give a diagnostic on what I believe may be wrong, and a simple way to fix it, but for now - let me give you the issues.
 
 
 
The Symptoms
 
 
Events
The first thing that comes to mind are events, such as "onclick", "onmousedown", "onmouseout", "onmouseover", etcetera.
 
 
When I try to do say....... An <img> element with an onclick parameter, when  I close the html editor, and open it again, the onclick has disappeared, leaving only the <img>.
 
For Example:
I paste in  
 
<img class="imgx" onclick="ace()" src="http://marsxplr.com/_upl/flyclubozc-orig.jpg" />
 
 Then I close the html editor, and open it again, and bam, what was once
 
 
<img class="imgx" onclick="ace()" src="http://marsxplr.com/_upl/flyclubozc-orig.jpg" />
 
is now
 
 
<img class="imgx" src="http://marsxplr.com/_upl/flyclubozc-orig.jpg" />"
 
 
 
Custom Parameters
This also happens with custom parameters - lets say you want to add a star rater from js - kit:
 
Conventionally you would put in 
 
 
<div class="js-kit-rating" title="Rated item" permalink=""></div><script src="http://js-kit.com/ratings.js"></script>
 
 
However lets say you want to make it score system - something that jsut shows the numbers of yays and nays, not a 1 through 5 average vote.
 
 
You would put in:
 
<div  view="score" class="js-kit-rating" title="Rated item" permalink=""></div><script src="http://js-kit.com/ratings.js"></script>
 
 
However the view="score" would end up disappearing, leaving you with a star rater.
 
 

» Reply to Comment
Re: Html Compatibilities two
2 weeks - 19,722v
Posted 2009/05/14 - 5:26 GMT
I hereby award you the most thorough bug report ever award :)
 
Your diagnosis is completley accurate, and you can even see my current "spell checker dictionary" if you search the source of a PlexPedia page with an embedded wysiwyg editor for "valid_elements".
 
I will eventually be disabling this feature and allowing you to post anything inside the fancy editor (as long as it is well formed, and doesn't look like an XSS attack) - but in the mean time there is a simple workaround.
 
To insert your own completley custom code into PlexPedia, all you need to do is temporarily disable javascript (Firefox: Preferences > Content > uncheck "Enable JS") in your browser while loading a submission page. No fancy editor, no "spell checker" bungling with your code.
 
All the best,
 
-Aubrey
» Reply to Comment
Re: Html Compatibilities two
5 weeks - 32,767v
Posted 2009/05/27 - 0:14 GMT
Brilliant! Thank you! Lately I have been using a javascript to edit the inner HTML of a <div> element, with the code I need, however some things, such as scr, became mce_scr scr, which as you might know, can become frustrating lol! You way is far simpler, and far more powerful! I have done this before but it never came across my mind that I could use it in such a way :D


This website is powered by Plexpedia
Usage of this site constitutes agreement to the » Legal Stuff