Freelancer: aneeshtclt
Chia sẻ:
Báo cáo bài thi

Modified code

I have added 'thirdEnable' variable in the script. sample code : window._3rd_party_test_step1_loaded = function(){ // At this point, a third-party domain has now attempted to set a cookie (if all went to plan!) var step2Url = 'http://aneesht.in/step2.js.php', resultsEl = document.getElementById('3rd_party_cookie_test_results'), step2El = document.createElement('script'); // And load the second part of the test (reading the cookie) step2El.setAttribute('src', step2Url); resultsEl.appendChild(step2El); } window._3rd_party_test_step2_loaded = function(cookieSuccess){ if(cookieSuccess){ //Third party cookies are functioning in your browser thirdEnable = 'true'; } else{ //Third party cookies appear to be disabled thirdEnable = 'false'; } if(thirdEnable == 'true') // do something }

Bài tham dự cuộc thi #9 cho                                                 Script to Check If Browser Accept 3rd Party Cookie
Bài tham dự #9

Bảng thông báo công khai

  • goldgain
    Chủ cuộc thi
    • cách đây 10 năm

    Hi Aneeshtclt,

    Before I started this contest, I already found the exact script from stackoverflow but I can't use it as my other script is unable to execute in < head > section.

    I need the 'thirdEnable' variable to be available in within the < body > < /body >. This is the main reason why I started the contest.

    • cách đây 10 năm