Hikari Email & URL Obfuscator – JavaScript markup
Introduction
Wordpress has a "bug" regarding marking up JavaScript inside posts and pages, and Hikari Email & URL Obfuscator unfortunately is affected by it. This "bug" breaks XHTML validation, and something has to be done to surpass it and have a properly valid XHTML code, while the "bug" is not solved.
If you wanna see the whole story, you can read it at XHTML, validation, JavaScript and Wordpress. Either way, here you will have a detailed description of Hikari Email & URL Obfuscator's options.
Inline js calls position
Let's start with the easier one.
As you probably already know, Hikari Email & URL Obfuscator is a plugin that obfuscates links, converting them into strings that don't look like links anymore, so that spambots and Search Engine crawlers don't identify them. And together with these gibberish strings, it also adds a JavaScript function call. It passes to this function, in the form of parameters/arguments, the data to be used by JavaScript to decrypt the original link data and restore it.
This function call looks like <script type="text/javascript">/* <![CDATA[ */HkMuobJS.write("hkmuob-id-7404",0,'uggc://jjj.pbagngbfrfcnpvnvf.pbz.oe',' gvgyr="Beqrz qbf Svyubf qn YHM"','Ordem dos Filhos da LUZ',false);/* ]]> */</script>
, and we have one of it for each link.
Inline js calls position refers to where this call is placed.
- If you choose the 1st option, All JavaScript calls should be added inline, together with each link, the script is inserted together with the obfuscated link, just after it, wherever the link is.
- If you choose the 2nd option, JavaScript calls should be added all together in the page's footer, the default one, the plugin will add to the page footer a script with a sequencial list of all these function calls together.
The advantage of the first one is that it's harder for spambots to find these data, because they are spreaded out among the page. The disadvantage is Wordpress's bug I've talked before, this option adds JavaScript code inside posts and pages, which may break XHTML validation if it's marked up as CDATA...
The advantage of the second option is that, since all function calls are done in the footer, the JavaScript *.js file can also be added to the footer increasing pages load a bit, and we don't face Wordpress and JavaScript incompatibility. But also, all data is placed together, always in the same place, making it easier to be found...
Also, if you choose the 2nd option (JavaScript calls should be added all together in the page's footer), you don't have to worry about how JavaScript is marked up, which I'm gonna talk now.
JavaScript markup
This setting only exists because of Wordpress breaking CDATA inside posts, when that issue be finally solved we'll just be allowed to forget this option. But for now, I've decided to let each user choose how to deal with this problem.
Again, if you want more details about how JavaScript is and should be marked up, I suggest reading XHTML, validation, JavaScript and Wordpress.
- Use
<!-- -->
in all scripts: HTML comment tags is used everywhere, this is how JavaScript was hidden in the past and should be avoided, but up until now it still works and is the most portable solution. Exemple:<script type="text/javascript">/* <!-- */HkMuobJS.write("hkmuob-id-7404",0,'uggc://jjj.pbagngbfrfcnpvnvf.pbz.oe',' gvgyr="Beqrz qbf Svyubf qn YHM"','Ordem dos Filhos da LUZ',false);/* --> */</script>
- Use
<![CDATA[ ]]>
in all scripts: the proper way of marking up JavaScript, and the prefered solution if previously you choose "JavaScript calls should be added all together in the page's footer", but troublesome of you prefere to place JavaScript calls together with each link. Exemple:<script type="text/javascript">/* <![CDATA[ */HkMuobJS.write("hkmuob-id-7404",0,'uggc://jjj.pbagngbfrfcnpvnvf.pbz.oe',' gvgyr="Beqrz qbf Svyubf qn YHM"','Ordem dos Filhos da LUZ',false);/* ]]> */</script>
- Use
<![CDATA[ ]]>
, with exception of the_content() areas, where<!-- -->
is used: the default option, using the correct markup wherever possible and deprecated one when required inside posts - Use nothing to delimit scripts: just to make these options complete, but this one has no reason to be used. Exemple:
<script type="text/javascript">HkMuobJS.write("hkmuob-id-7404",0,'uggc://jjj.pbagngbfrfcnpvnvf.pbz.oe',' gvgyr="Beqrz qbf Svyubf qn YHM"','Ordem dos Filhos da LUZ',false);</script>
Conclusion
That's it, I hope with this article I have detailed what these options do.
I hope someday Wordpress is fixed and they can be removed, because users shouldn't really need to worry about surpassing core bugs after all.
Thanks for reading, any question just leave a comment ^-^
Popularity: 7%
It has accumulated a total of 25,956 views. You can follow any comments to this article through the Comments RSS 2.0 Feed. You can leave a comment, or trackback from your own site.
Readers who viewed this page, also viewed:
Related Posts:
- Hikari Email & URL Obfuscator
- Hikari Internal Links - Exemples
- Wordpress
- Hikari Email & URL Obfuscator - Advanced Usage
- XHTML, validation, JavaScript and Wordpress
- Hikari Category Permalink
- Hikari Internal Links
- Hikari Unicornified Gravatars
- Wordpress comments: new built-in feature X Wordpress…
- Hikari Titled Comments
Comentando vc contribui e participa na criação do conteúdo do site.
Contribua. Commente. :)
(Os comentários abaixo representam a opinião dos visitantes, o autor do site não se responsabiliza por quaisquer consequências e/ou danos que eles venham a provocar.)