Hmmm
It still doesn’t seem to be working. I have done exactly as you have said.
This is what is on the page:
<!-- load the script loader -->
<script src="http://ivegotkids.com/wp-content/themes/thepink/usability.js"></script>
<script>
function doesCookieExist(cookieName) {
return !!$.cookie(cookieName);
}
function scriptLoaded() {
try {
_bvt.initSite('cd46ee4c-d008-40e9-bea4-b09fe7f792fa');
} catch (err) {}
}
if (doesCookieExist('the_cookie')) {
$script('http://sdscdn.userreport.com/popup.min.js', scriptLoaded);
} else {
// set the cookie, so that when they return, they can fill out the survey...
$.cookie('the_cookie', 'yepper', { expires: 365 });
}
</script>
And this is what is in the referenced js file (usability.js)
/*!
* $script.js Async loader & dependency manager
* https://github.com/ded/script.js
* (c) Dustin Diaz, Jacob Thornton 2011
* License: MIT
*/
!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"?module.exports=b():this[a]=b()}("$script",function(){function s(a,b,c){for(c=0,j=a.length;c<j;++c)if(!b(a[c]))return m;return 1}function t(a,b){s(a,function(a){return!b(a)})}function u(a,b,c){function o(a){return a.call?a():f[a]}function p(){if(!--m){f[l]=1,j&&j();for(var a in h)s(a.split("|"),o)&&!t(h[a],o)&&(h[a]=[])}}a=a[n]?a:[a];var e=b&&b.call,j=e?b:c,l=e?a.join(""):b,m=a.length;return setTimeout(function(){t(a,function(a){if(k[a])return l&&(g[l]=1),k[a]==2&&p();k[a]=1,l&&(g[l]=1),v(!d.test(a)&&i?i+a+".js":a,p)})},0),u}function v(a,d){var e=b.createElement("script"),f=m;e.onload=e.onerror=e[r]=function(){if(e[p]&&!/^c|loade/.test(e[p])||f)return;e.onload=e[r]=null,f=1,k[a]=2,d()},e.async=1,e.src=a,c.insertBefore(e,c.firstChild)}var a=this,b=document,c=b.getElementsByTagName("head")[0],d=/^https?:\\/\\//,e=a.$script,f={},g={},h={},i,k={},l="string",m=!1,n="push",o="DOMContentLoaded",p="readyState",q="addEventListener",r="onreadystatechange";return!b[p]&&b[q]&&(b[q](o,function w(){b.removeEventListener(o,w,m),b[p]="complete"},m),b[p]="loading"),u.get=v,u.order=function(a,b,c){(function d(e){e=a.shift(),a.length?u(e,d):u(e,b,c)})()},u.path=function(a){i=a},u.ready=function(a,b,c){a=a[n]?a:[a];var d=[];return!t(a,function(a){f[a]||d[n](a)})&&s(a,function(a){return f[a]})?b():!function(a){h[a]=h[a]||[],h[a][n](b),c&&c(d)}(a.join("|")),u},u.noConflict=function(){return a.$script=e,this},u})
This is the page I have tested it on:
http://ivegotkids.com/submitarticles
You can see there when you load that page, no survey comes up (which you’d think was okay if you were a first time visitor) but when you reload the page, you should get the survey but you don’t.
I’ve done something wrong :-s