- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Capture Referrer using JavaScript
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
2 years 7 months ago #219406
by blocka
Capture Referrer using JavaScript was created by blocka
While I know there is a built in feature to capture referrer in the response table, I'm wondering if there is a way for me to use javascript in my first question to capture the referrer?
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13642
- Thank you received: 2491
2 years 7 months ago #219413
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Capture Referrer using JavaScript
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: tpartner
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10108
- Thank you received: 3593
2 years 7 months ago #219449
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Capture Referrer using JavaScript
Yes, this script will work in the source of a short-text question as long as the question is placed in the first group and the welcome screen is not be shown.
Code:
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ $('#question{QID} :text').val(document.referrer); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.