I'm trying over to embedding Surveymonkey to Wordpress. But it seems I need to do something or otherwise it doesn't work - surveymonkey

So there a few instructions on google searching how to embed Surveymonkey's survey over Wordpress.
According to given instructions, what I need to do is just copy and paste of HTML code from Surveymonkey. But seems there are more things I need to do with or maybe I'm doing something wrong.
Is there something I have to do? Or how I can see the survey in Wordpress?
Thanks for your help.
When it embeds in Wordpress, other mobile or tablet users wont' be able to see the survey over their mobile screens by the way? I read somewhere that the survey no longer available though.
(function(t,e,s,n){var o,a,c;t.SMCX=t.SMCX||[],e.getElementById(n)||(o=e.getElementsByTagName(s),a=o[o.length-1],c=e.createElement(s),c.type="text/javascript",c.async=!0,c.id=n,c.src=["https:"===location.protocol?"https://":"http://","widget.surveymonkey.com/collect/website/js/tRaiETqnLgj758hTBazgd_2FxosSgj773ROkNWSmWZyyP6Hb11hv4dFCD0s0WMi0bR.js"].join(""),a.parentNode.insertBefore(c,a))})(window,document,"script","smcx-sdk");https://www.surveymonkey.com> Create your own user feedback survey

To answer your first question, you can use the code below
HTML
<div id="smcx-sdk">
</div>
Javascript
<script>
(function (t, e, s, n) {
var o,
a,
c;
t.SMCX = t.SMCX || [], e.getElementById(n)
|| (o = e.getElementsByTagName(s),
a = o[o.length - 1],
c = e.createElement(s),
c.type = "text/javascript",
c.async = !0, c.id = n,
c.src = ["https:" === location.protocol ? "https://" : "http://", "widget.surveymonkey.com/collect/website/js/tRaiETqnLgj758hTBazgd_2FxosSgj773ROkNWSmWZyyP6Hb11hv4dFCD0s0WMi0bR.js"].join(""),
a.parentNode.insertBefore(c, a))
})(window, document, "script", "smcx-sdk");
</script>
Therefore, please make sure your Javascript is wrapped in a <script> tag as above and that you create an element (such as a div) with an id named smcx-sdk
To answer your second question, consider the following Stack Overflow answer:
https://stackoverflow.com/a/34932110/4150884

Related

I am unable to access a variable used in my select tag from my ModalInstance controller

I have taken the codes shared from the Modal example page and instead of an LI I have decided to use a select element. My select element has ng-model="selectedColor" in it, and I can use {{selectedColor}} all over the partial I created, however, I can not use "$scope.selectedColor" from the "Model Instance Controller" or any controller for that matter. I assume this is because something is off with $scope but I cant seem to figure it out. Any help is appreciated.
http://plnkr.co/edit/MsNBglLJN0hWxvGZ1pj1?p=preview
The problem in your code is that $scope.selectedColor and the selectedColor in the modal markup are two different references. For details on this, please read Understanding Scopes, you will probably benefit from it as it is a common task.
Instead of writing $scope.selectedColor, you should make an object in your controller, then store the result in it.
var ModalInstanceCtrl = function ($scope, $modalInstance, colors) {
$scope.colors = colors;
$scope.o = {}
$scope.ok = function () {
console.log($scope.o.selectedColor, "$scope.o.selectedColor");
$modalInstance.close($scope.o.selectedColor);
};
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
};
and in the markup, refer to o.selectedColor.
Here is a working version of your Plunker

Is it possible to post a link that targets a specific choice in an accordeon so to open automatically?

I have a page that contains multiple topics in accordion.
How can I post a link (on social media or other places) so when the user clicks it can view the topic I want without making him choose the desired one to view it?
The website is built in Joomla 2.5 using its native (mootools) accordions.
A temporary solution came to my mind is to make single pages containing only the content I want, but it won't help them view the other topics contained in the same page, unless the user clicks the same category.
MooAccordion has a display option. You could use like:
window.addEvent('domready', function () {
var index = window.location.search; // get query string
index = index.replace("?", ''); // remove the ?
index = index.length ? index : 0; // in case there in no query, display first
var myAccordion = new Fx.Accordion($('accordion'), '#accordion h2', '#accordion .content', {
display: index // the actual behavior you are looking for
});
});
Read more at Mootools docs
So you could try these links as demo:
http://jsfiddle.net/brM2v/show/?0
http://jsfiddle.net/brM2v/show/?1
http://jsfiddle.net/brM2v/show/?2

jquerymobile url parameters

Have asked two questions and not getting an answer and having spent a few hours trying to find the answer without success I am wondering if someone can finally help me.
I need to generate dynamic urls and pass through parameters on jquerymobile.
example..
Menu 2
Result No. 4
The above urls need to be dynamic and I need to be able to pass through a parameter of ID.
I then need to get the id parameter on the given page.
I have read lots regarding changePage etc but I can specify in the function which page will be next as it needs to be dynamic. I also need the ajax transitions to work so ajax-false needs to be true.
Please help once and for all and provide me with sample code.
Kind Regards.
Ok, to get the url parameter on the page you navigated in, use something similar to the following.
It uses pageshow event to get the ID from the current URL.
I have used the function from the answer on this question - Get escaped URL parameter:
$(document).on("pageshow", function(event, data) {
var id = getURLParameter("id");
console.log("ID = " + id);
});
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
If the above regex doesn't work means try with this change
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(window.location.href)||[,null])[1]
);
}

How to use jQuery UI with Play Scala

I'm looking to do a Play Scala project where I'll do especially drag & drop.
Is jQuery UI the best and the simplest way to do that? and How could one do this? could someone give me some examples or pointers?
In Play 1.0 there is a good example on how to use jQuery UI (http://www.playframework.com/modules/jqueryui-1.0/home) but I don't found examples or documentation on Play2.0 Scala !
first of all you need to define an endpoint for your data in the controller.
Simething like this:
def autocompleteSearch(a: String) = Action {
request =>
val data = List("apple", "apple iphone", "apple ipad", "microsoft windows", "microsot office");
val filteredData = data.filter(_.startsWith(a))
Ok(Json.toJson(filteredData))
}
Then you need to add this endpoint to your routes:
GET /some-ajax controllers.Application.autocompleteSearch
Then in your .scala.html file you can write a script that will do a get you you, example:
var updateTime = function() {
$.get("#routes.Application.timeUpdate()", function(data) {
display.html(data)
})
return false
}
When you have the var you just pass it to the jQueryUI.
My examples are copied from different things and they don't really fit together :) but I hope you can grasp the general idea.
Sorry the answer is not more specific, but I'm no JavaScript master and had to fight with the jQuery once, and this is what I have left from the struggle.
Cheers!

Info Window URL needs to be prefixed with http NOT the default https

I am using the following code in the fusion tables 'customize info window' to create hyperlinked URL's from a column in my table:
"{URL}"
This works fine in returning the clickable hyperlink in the info box except fusion maps by default tacks on https: instead of http: when the link is clicked. This causes problems when the user clicks the hyperlink and it tries to take them to a secure site when in fact it is not secure. The browsers throw up all sorts of warnings that will scare the pants off a lot of users who don't know what is happening.
Does anybody know how to remedy this and have the default be http and not the current https?
Thanks, Shep
You may want to abandon the "{URL}" approach and display the hyperlink with some simple HTML. This example from Google shows how to modify the info window's HTML in Javascript:
google.maps.event.addListener(layer, 'click', function(e) {
// Change the content of the InfoWindow
e.infoWindowHtml = e.row['Store Name'].value + "<br>";
// If the delivery == yes, add content to the window
if (e.row['delivery'].value == 'yes') {
e.infoWindowHtml += "Delivers!";
}
});
Changing the e.row['Store Name'] to your URL column name (maybe, e.row['URL']) and surrounding by a couple of hyperlink tags <a> should do the trick:
e.infoWindowHtml = "<a href='" + e.row['URL'].value + "'>Click here!</a>";
There are three ways:
Specify a full URL including protocol in your data
Use Link here in a custom info window layout
Completely override the content as in the answer above
I would recommend #1 because you can choose the right protocol for every link. However #2 is probably easier in that you can leave your data the way it is.

Resources