Problem with 'spread the word' badge?
I used the first (smaller vertical) badge at https://www.mozilla.org/en-US/plugincheck/ on my Wordpress blog but although it shows the badge, it also shows the second half of the HTML: "var pfsNextImage = "https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/safe.png";var pfsUpdateImage = "https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/upyourplug.png";" If I remove that part, it just shows the badge, but do I lose anything but not including the part I've removed?
The whole code is:
<a href="https://www.mozilla.org/en-US/plugincheck/"><img id="mozilla_plugin_checker_badge" src="https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/loading.png" width="180" height="150" alt="We can check your plugins and stuff" border="0" /></a><script type="text/javascript">var pfsNextImage = "https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/safe.png";var pfsUpdateImage = "https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/upyourplug.png";</script><script src="https://www.mozilla.org/js/plugincheck_badge.js"></script>
Được chỉnh sửa bởi cor-el vào
Tất cả các câu trả lời (6)
That text is part of a script tag, so you shouldn't be seeing it.
Can you post a link to your blog site so we can check the code for errors?
Do you see any red text if you inspect the page source via the right-click context menu?
Thanks for replying. My blog is at http://adeunsheep.wordpress.com/
You will see two versions of the badge on my blog, on the right sidebar. One is 'cleaned up' where I've removed the script tag (and the link seems to work fine), the other, further down, shows the badge with the whole text including the script tag.
Not sure what "inspect the page source" means but I've tried both 'view page source' and 'inspect element' on the text both on the Firefox page where I found the badge and on my blog (from within the widget placing area, on the blog itself logged in and logged out); 'view page source' shows red text, namely numbers preceded by a #, forward slashes (/), &, >, (there's also a lot of blue and purple, and some bold black); 'inspect element' shows no red text.
As I say, I've found a workaround but figured it was worth pointing out. I must admit I don't understand how the link works without the script tag but then, I'm a complete novice where code of any sort is concerned!
If you look at the page source then you will notice that the script tags are missing, so that text in now normal text and rendered as such.
So in this case there isn't an error in the text, but only the script tags got lost.
If you didn't do that then maybe the blog software did (removing unrecognized or not white-listed tags).
<li id="text-4" class="widget widget_text"> <h2 class="widgettitle">test</h2> <div class="textwidget"> <a href="https://www.mozilla.org/en-US/plugincheck/"> <img src="https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/loading.png" width="180" height="150" alt="We can check your plugins and stuff" border="0" /> </a> <!-- this text should be in a script tag --> var pfsNextImage = "https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/safe.png"; var pfsUpdateImage = "https://www.mozilla.org/img/covehead/plugincheck/wb/en-US/180_150/upyourplug.png"; </div> </li>
Được chỉnh sửa bởi cor-el vào
You're quire correct. I've just gone through the whole process again, made sure it says " </a><script type="text/javascript"> " before hitting save (on the wiget page of my WordPress blog), and lo and behold, when I hit save it removes it! Why? Guess that's a question for WordPress.
Thanks for your help, cor-el.
Sorry that should have been "quite correct" !
I've just visited WordPress's Help page for widgets and discovered that Javascript is not allowed as it can be used for malicious reasons. They allow it for YouTube and Google though as they are "trusted partners" - about time they made Firefox a trusted partner! Given that YouTube is owned by Google, I wonder if WordPress has some kind of special deal going with Google to disadvantage Firefox users?