Created
February 8, 2014 18:39
-
-
Save corajr/8888071 to your computer and use it in GitHub Desktop.
Hide link on MTurk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- paste this at the top of your HIT's source --> | |
| <script type="text/javascript"> | |
| function turkGetParam(name) { | |
| name = name.replace(/[[]/,"\[").replace(/[]]/,"\]"); | |
| var regexS = "[?&]"+name+"=([^&#]*)"; | |
| var regex = new RegExp(regexS); | |
| var results = regex.exec(window.location.href); | |
| if (results == null) { | |
| return ""; | |
| } else { | |
| return results[1]; | |
| } | |
| } | |
| document.addEventListener('DOMContentLoaded', function () { | |
| var assignmentId = turkGetParam('assignmentId'); | |
| if (assignmentId != '' && assignmentId != 'ASSIGNMENT_ID_NOT_AVAILABLE') { | |
| document.querySelector(".hiddenUntilAccept").style.display = 'inline-block'; | |
| } | |
| }, false); | |
| </script> | |
| <style type="text/css">.hiddenUntilAccept { display: none; } | |
| </style> | |
| <!-- wrap your link in a div or span of class hiddenUntilAccept--> | |
| <p>Spreadsheet (hidden until HIT accepted): | |
| <span class="hiddenUntilAccept"><a href="${surveyurl}" target="_blank"></a></span> | |
| </p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment