views:

746

answers:

2

I have a Facebook application that is using FBML and I want to include the UserVoice feedback tab widget on my app's pages. I copied and pasted the JavaScript into my FBML page, but when Facebook renders the page, that JavaScript is removed, so the tab doesn't show up.

Does anyone have experience with Facebook's modified version of JavaScript and getting the UserVoice tab to work on a FBML page?

Here's the JavaScript code:

<script>
<!--
  var uservoiceJsHost = ("https:" == document.location.protocol) ? "https://uservoice.com" : "http://cdn.uservoice.com";
  document.write(unescape("%3Cscript src='" + uservoiceJsHost + "/javascripts/widgets/tab.js' type='text/javascript'%3E%3C/script%3E"))
//-->
</script>
<script>
<!--
UserVoice.Tab.show({ 
  /* required */
  key: 'callme',
  host: 'callme.uservoice.com', 
  forum: '31286', 
  /* optional */
  alignment: 'left',
  background_color:'#f00', 
  text_color: 'white',
  hover_color: '#06C',
  lang: 'en'
})
//-->
</script>
+2  A: 

Forget about JavaScript. Just include the following HTML:

<style type="text/css">
#uservoice-dialog { z-index: 100003; display: block; text-align: left; margin: -2em auto 0 auto; position: absolute; } #uservoice-overlay { position: absolute; z-index:100002; width: 100%; height: 100%; left: 0; top: 0; background-color: #000; opacity: .7; filter: alpha(opacity=70); } #uservoice-dialog[id], #uservoice-overlay[id] { position:fixed; } #uservoice-overlay p { padding: 5px; color: #ddd; font: bold 14px arial, sans-serif; margin: 0; letter-spacing: -1px; } #uservoice-dialog #uservoice-dialog-close { position: absolute; height: 48px; width: 48px; top: -11px; right: -12px; color: #06c; cursor: pointer; background-position: 0 0; background-repeat: no-repeat; background-color: transparent; } * html.dialog-open body { height: 100%; } * html.dialog-open, * html.dialog-open body { overflow: hidden; } html.dialog-open object, html.dialog-open embed, * html.dialog-open select { visibility: hidden; } * html #uservoice-overlay { width: 110%; } * html #uservoice-dialog #uservoice-dialog-close { background: none; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://uservoice.com/images/icons/close.png'); } a#uservoice-dialog-close { background-image: url(http://cdn.uservoice.com/images/icons/close.png); }
</style>
<a href="YOUR_USERVOICE_PAGE_URL_HERE" id="uservoice-feedback-tab">Feedback</a>

That should put a UserVoice tab up on your page. You can customize the CSS as much as you like.

Note that this skips the UserVoice modal dialog (which wouldn't work very well on Facebook anyways) and takes users directly to your UserVoice homepage.

Portman
Looking at this in more detail now, you've got a bunch of css classes, but how/where are you proposing to use those?
Dennis Palmer
The only thing the UserVoice JavaScript does is add those classes and a couple of elements to your page. The CSS is actually more than you need; if you wanted to you could just pick out the "uservoice-feedback-tab" style.
Portman
A: 

How did you get along with this?

I would like to intergrate www.monyta.com feedback tab as well

Thanks

Scott

related questions