surveymonkey popup not showing - surveymonkey

I setup a wordpress blog and wanted to add a popup from surveymonkey. To simply test if it gets loaded I added the script within the footer.php before the closing body tag. Then I reloaded the page but the popup didn't appear, I tried the same with an empty html page where it did work.
Then I compared the developer console and it seems that not everything gets loaded. For some reason after the object has been loaded nothing else gets loaded. I even tried to add the script to another project (not wordpress) but it doesn't work either.
I also tried to setup a new collector and added the script tag again to my project. The popup has been loaded, but after I reloaded the page the same happens as before. It does work though when I use an embedded survey, instead of a popup survey.
Here are my results on firefox:
Any page
Empty page
What am I doing wrong here?

Wanted to add in the edit This is the correct answer but also I wanted to give context to why the default nature SurveyMonkey creates here is not good. If the end user activates the survey a single time the fact that it would not open again makes no sense and is a poor user experience.
The user would never know, if they closed the survey prematurely, that there was no reason that the activation of the survey could not be completed again.
SurveyMonkey allows for the survey to be taken again until it is completed and then the survey would explain to the user they have already completed the survey. This is a good user experience and sufficient.
***End edit
Just chiming in here, despite this being an old question. The previous answer is absolutely correct as the Survey Monkey popup will only display once and there's nothing you can do via the Survey Monkey interface to get it to show multiple times in a single browser session.
However, you can resolve this issue by adding the following JS above your Survey Monkey JS code:
<script>document.cookie = 'smcx_0_last_shown_at=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';</script>
This code clears a cookie created by the Survey Monkey pop up that keeps track of when it was last displayed, so it'll display every time the page is refreshed without the need to end the current browser session.

I know this is an old question, but I am posting a reply in case it helps someone else. It appears that Survey monkey limits the number of time the pop up shows to once per browser session.
I have tested in Chrome, Firefox & Edge and I was able to reproduce this behavior very consistently.
If either the embed or the pop has shown up once, the pop up will not show up a second time until you either close and re open the entire browser, or load the page in incognito/private browsing mode. But you will still need to close and re open the private/incognito browser window/tab each time you reload the page containing the pop up.
As of yet, I have not found an option within the Survey Monkey interface to disable this behavior for the pop up survey. Note that the embed survey does not suffer from this.

Related

Microsoft Edge requesting new page on back/forward button

The latest version of the Microsoft Edge browser (41.162...) requests a new page when the back and forward buttons are clicked. I've tested multiple browsers on multiple platforms and only Edge exhibits this behavior.
Here's a test page that displays the timestamp the page was created. Click the "Next Page" link and then use the back and forward buttons. Notice that the timestamp is different each time for Edge but not other browsers.
The previous version of Edge did not request a new page each time.
I don't think StackOverflow is the best place to post this as there won't be an easy workaround for this beside circumventing most of the browser internals via your own UI & cacheing and that can be broken by the user clicking the back button that they're accustomed to. I recommend filing a bug on Edge here: http://bugs.microsoftedge.com to find out if it's by design or not and potentially get it fixed. Additionally, please make sure to state why this is impactful to your site and more importantly to your end users.
One reason I can see fetching the URL again is that the content will be fresh because not every user wants to go back to "stale" content they just want to go back to that page, for example - and doing a new navigate ensures a clean slate.

CakePhP jquery debuging modal dialogs data flow

I have quite a big application, sometimes with pretty complicate data being created by the user (on the way to the database the data is being altered a lot). The issue is, that any time I need to alter the code, I get stuck for quite a few hours before finding the problem.
Actions in my app:
User opens the jquery modal dialog
There is a form in the modal dialog
User alerts the data and saves it
About app:
The application contains of one site with a table and several buttons
Each of these buttons open a different modal dialog
Each form submission is handled via ajax -> cakephps this->js->submit
How I wrote the code:
For each modal dialog I created an element
After clicking the button I open the element as a jquery modal dialog
Lots of these modals gain information via for example: "On click/on double click etc" events.
My problem:
Every time I alter the cakephp code which is called by $this->Js->submit I feel like putting a gun to my face and pulling the trigger.
I dont know of any easy way of how to debug variables in these functions (cakephps debug doesnt show anything ofc -> the view of those ajax/php functions are not in the main site)
Dont know if firebug has any features for debugging php, but I dont know of any.
The only thing that works for me a bit is commenting out lines of code and putting an alert in the success like this to maybe sometimes get to the values, but it doesnt feel right.
Being used to write code in c++/java and printing or debugging with breakpoints makes me frustrated, when I use such a modern programming language and try to guess out where the bugs might be..
Most errors:
Mostly null pointers or checking !isset index being accessed, but since I know of no way of printing these errors from modals no checking on the indexes helps me.
Use FirePHP it is a great enhancment of firebug. Works well.

PhoneGap transaction not triggering its first parameter after changing jQuery Mobile page and getting back

On a jQuery Mobile page, I call the PhoneGap Storage function like this:
window.database.transaction(performQuery, error);
And it works. I can use it several times, and it always works.
Then, I use jQuery.mobile.changePage() to change to a different page, then call history.back() from that second page, and back to the original page performQuery() does not get called anymore.
I placed alert() functions both before and after the call to transaction(), and placed one at the beginning of the definition for performQuery(), but the third alert() is never reached after getting back from the second page.
This also occurs with a transaction I put on the second page. It works the first time the second page opens, but it doesn't when I get back to the former page and then back to the second page again.
Also to be noted this question might have the same answer as this other question, although I cannot be sure.
It turns out the culprit is the OS. According to a workmate, Android Honeycomb gives trouble in this regard, something to do with the page change.
Anyway, things work as expected on a different Android device.

Wrong controls initialed on page refresh

https://gist.github.com/773373
Non relevant fields are initialized on page refresh.
Steps to reproduce
Access the page. Notice the two alerts. "init - uncheck" and "enabled - uncheck".
Select the check box. Check control is initialized. Two alerts again. This control was not relevant previously.
Refresh the page (I am using firefox). Notice the non-relevant control is initialized but the relevant control is not. You can tell from the alerts.
Interestingly the right component is shown but xforms-enabled is called on the wrong component.
Getting those 2 alerts for the non-relevant control on page refresh is normal. However, after those, you should also get alerts for the newly relevant control. I created a bug for this, and will update this response when the issue is fixed.
When you do a reload (ctrl-r) on Firefox, the HTML is in its initial state, as it was the first time the page was loaded. However, since Firefox resets the form fields to their value before the reload, we can detect with JavaScript that a reload happened, and the browser can ask the server "please tell me everything I need to do on the initial HTML to put it back to state X". The server resends all the events it sent when you clicked on the checkbox, except the <xxf:script>, which is responsible for your script running, hence the behavior you observe.
We did some brainstorming on this issue, and described a solution, which at this point still need to implement.

How to redirect user to the page they were just at without them noticing?

The website viewer would be at page A, click a link that sends then to page B, but I want them to return to page A without them noticing.
When they click the link it changes the layout the viewer is browsing the site with, so the redirection code shouldn't erase or undo the cookies or whatever are stored with the link click. Thanks!
Edit:
Here's what I'm doing. I have a page called setskin.php that has php code that takes header and footer codes for different layouts and applies them. I don't know how to show code without it going crazy, so there's a screenshot of it here:
http://figmint.uuuq.com/Picture%202.png
I want to change my website so that in a sidebar there will be the same setskin options (so it will be on every page). I was fiddling and managed to make it so when you click the link for the skin you want it changes the skin, but then you end up at the setskin.php page, which I don't want. I was looking for a way to make it so it sends you to the setskin.php page (since I couldn't see how to change that) and then back to where you came from.
You should use AJAX. That way you can do whatever processing is needed behind the scenes with zero impact on the user.
You can check the referer header and return to that. But if that isn't set go to a default page?
Other options include putting the previous url as a parameter, like a 'next' parameter. Then redirect to that after you're done. Quite common pattern used for login.

Resources