본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

Problem with 'spread the word' badge?

  • 6 답장
  • 34 이 문제를 만남
  • 1 보기
  • 최종 답변자: AdeH

more options

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>
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<i></i>.mozilla<i></i>.org/img/covehead/plugincheck/wb/en-US/180_150/safe.png";var pfsUpdateImage = "https://www<i></i>.mozilla<i></i>.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: <pre>&lt;a href="https://www<i></i>.mozilla<i></i>.org/en-US/plugincheck/"&gt;&lt;img id="mozilla_plugin_checker_badge" src="https://www<i></i>.mozilla<i></i>.org/img/covehead/plugincheck/wb/en-US/180_150/loading<i></i>.png" width="180" height="150" alt="We can check your plugins and stuff" border="0" /&gt;&lt;/a&gt;&lt;script type="text/javascript"&gt;var pfsNextImage = "https://www<i></i>.mozilla<i></i>.org/img/covehead/plugincheck/wb/en-US/180_150/safe.png";var pfsUpdateImage = "https://www<i></i>.mozilla<i></i>.org/img/covehead/plugincheck/wb/en-US/180_150/upyourplug.png";&lt;/script&gt;&lt;script src="https://www<i></i>.mozilla<i></i>.org/js/plugincheck_badge.js"&gt;&lt;/script&gt;</pre>

글쓴이 cor-el 수정일시

모든 댓글 (6)

more options

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?

more options

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 (/), &amp, &gt,   (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!

more options

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>

글쓴이 cor-el 수정일시

more options

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.

more options

Sorry that should have been "quite correct" !

more options

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?