winteram / IAT

Online IAT
MIT License
42 stars 48 forks source link

Running perfectly on explorer, but nothing else #22

Open dmsteak opened 9 years ago

dmsteak commented 9 years ago

Greetings folks!

I love this code for the IAT, but I am stuck on how to get it to work on all browsers. As of right now, I can only get it to work on explorer on my laboratory computer, but we plan to collect data over a listserv. As such, we have little control over browsers- we need this to work in most (or at least a majority) of browsers, but right now it only works in explorer. Otherwise, it simply gives the message "Javascript must be enabled for the application to run. Please enable javascript to continue."

I am reasonably new to Javascript, so I apologize if this is obvious- I've been messing with this for a week and can't seem to figure out the issue. We have modified program files slightly with more appropriate instructions for our task. The URL for the program is as follows (it will be embedded into another survey)

cas.illinoisstate.edu/edwesse/research/iat/index.php

Any help as soon as possible would be greatly appreciated!

Thanks! Diana

nolach commented 9 years ago

Hey Diana,

I think I may have found the problem. On line 321 of IAT.js, you've added the following line:

resulttext = "<div style='text-align:center;padding:20px'>Thanks for participating! <a href="cas.illinoisstate.edu/edwesse/research/iat/DebriefingPacket.pdf" target="_blank">Click here to download the debriefing statment and packet</a></div>";

The double quotes in the resulttext variable are not escaped, causing a JavaScript error. Try replacing this line with the below code:

resulttext = "<div style='text-align:center;padding:20px'>Thanks for participating! <a href='cas.illinoisstate.edu/edwesse/research/iat/DebriefingPacket.pdf' target='_blank'>Click here to download the debriefing statment and packet</a></div>";

Let us know if that solves your problem! Steven

dmsteak commented 9 years ago

This worked!! Thank you!!