First-listed Widget Code Under "Widgets" Seems It Is Missing Code...

  • Question
  • Updated 2 years ago
  • Answered
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Community cleanup. Topic has not had much activity or pageviews. If you still have this question please repost in the community! :)

Hi...something appears to be wrong with the code I am getting for the top-listed widget under "Widgets"...

It appears to be missing a lot. For the hell of it, I tried testing the code shown in the screenshot, just to make sure, and it produced "nothing":

Any idea how that first-listed widget code is really supposed to look - and why the above is being shown to me as "the" code for this widget?

Thanks!

Andy

Andy Cooper

  • 11 Posts
  • 0 Likes
  • confused

Posted 2 years ago

  • 1

Amy Cottrell, Official Rep

  • 247 Posts
  • 11 Likes
Hi Andy,

Thanks for your question and I'm sorry for any confusion. I've shared this with our tech team and someone will follow up with you shortly. Thank you for your patience!

Amy :)

Nick Marden, Systems Engineer

  • 3 Posts
  • 4 Likes
Hi Andy,

Believe it or not, our code snippet for the widget really is that small! Basically all the Javascript does is construct a URL that points to a file that contains the "real" Javascript for the widget, loads that URL, and then executes a few commands to configure and kick off the widget execution. The constructed URL for the "real" widget code should look something like this:

https://d3rdqalhjaisuu.cloudfront.net/javascripts/feedback-v2.js

As you'll see, there's a lot of code in that file. It defines the GSFN Javascript object, which is later instantiated and told to run in the last line of the code block:

var feedback_widget = new GSFN.feedback_widget(feedback_widget_options);


If the Javascript isn't working for you in a test page, please contact our support team with a copy of the exact HTML file you're having trouble with, and one of our awesomely helpful support people will work through the issue with you.

Cheers,

Nick

Andy Cooper

  • 11 Posts
  • 0 Likes
Thanks, Nick and Amy! Well, I just sent the code and question to support@getsatifaction.com. Was this okay? Or should I have posted it right here? :-) I can still do that, if needed.

Matter of fact, for the heck of it...

I put this in STYLE.CSS on my Wordpress site, but apparently, that's not the correct thing to do...

Thanks...

Andy

Andy Cooper

  • 11 Posts
  • 0 Likes
Hmmm...added copy/paste of the code, but it's not showing here...???

Nick Marden, Systems Engineer

  • 3 Posts
  • 4 Likes
Hi Andy,

If you're going to paste code into a reply/comment it's best to put "code" tags around it, like this:

< code >
(your HTML here)
</ code >

so that our HTML sanitizer doesn't eat what you posted.

Note that you have to remove the spaces from the code tags - I put them there to work around our HTML sanitizer eating *them*. :-)

Andy Cooper

  • 11 Posts
  • 0 Likes
Got it, Nick! Here's the code...



<script type="text/javascript" charset="utf-8">
var is_ssl = ("https:" == document.location.protocol);
var asset_host = is_ssl ? "https://d3rdqalhjaisuu.cloudfront.net/" : "http://d3rdqalhjaisuu.cloudfront.net/";
document.write(unescape("%3Cscript src='" + asset_host + "javascripts/feedback-v2.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript" charset="utf-8">
var feedback_widget_options = {};

feedback_widget_options.display = "overlay";
feedback_widget_options.company = "ifixpcz";
feedback_widget_options.placement = "left";
feedback_widget_options.color = "#222";
feedback_widget_options.style = "idea";

var feedback_widget = new GSFN.feedback_widget(feedback_widget_options);
</script>

Nick Marden, Systems Engineer

  • 3 Posts
  • 4 Likes
OK, so I put that in a text file using a text editor (like Notepad or TextEdit, depending on your favorite platform) and saved it as "test.html". When I opened test.html in a browser, I got this:



and when I clicked on the Feedback tab on the side of the browser, I got this:



...so I think everything is working OK.

Did you save the snippet into/as an HTML file? If so, did you put it on a public site where I can see it to help you debug?

Cheers,

Nick

Andy Cooper

  • 11 Posts
  • 0 Likes
Hi, Nick...

Actually, I did the same test - and it worked. The problem is that I can't figure out WHERE to put this code on my Wordpress website to get it to work. Any ideas? I created a gswidget,html file in the root directory - nothing. I added it to style.css - nothing, I am not a Wordpress expert by any means, and it must be that the code is not in the right place.

Andy

Jenn Lin, GetSat Alumni

  • 529 Posts
  • 19 Likes
Hi Andy!

It sounds like you have the right code and it just needs a hope.

The Style.CSS file won't work for you, because it just is intended for CSS code. What you need is access to the &ltbody&gt element of the page.

Do you want this widget on all pages on the WP site? That makes me think it needs to go in a template. Or is this just for a specific page?

Thanks!
Jenn

Andy Cooper

  • 11 Posts
  • 0 Likes
Hi, Jenn...

Yes, I want it to go on all 4 pages of my website.

So...any ideas? :-)

Andy

Andy Cooper

  • 11 Posts
  • 0 Likes
I got it!!

I just added the code within the body tags in my footer.php file.

Everything's fine now. Thanks to both of you for your help!!

Andy

Jenn Lin, GetSat Alumni

  • 529 Posts
  • 19 Likes
Excellent, I am so glad it is working. Thank you for letting us know.

Jenn

This conversation is no longer open for comments or replies.