Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6092031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:23:46+00:00 2026-05-23T12:23:46+00:00

can anyone please tell me what is the error on this code? I am

  • 0

can anyone please tell me what is the error on this code? I am trying to set a cookie for the fancybox popup but it is showing on every refresh. All .js are included.

<script>

$(document).ready(function(){

if(!$.cookie('the_cookie1')){
    $.cookie('the_cookie1', 'true', { expires: 3});

$.fancybox(
        '<h2>Hi!</h2><p>Lorem ipsum dolor</p>',
        {
                'autoDimensions'    : false,
            'width'             : 350,
            'height'            : 'auto',
            'transitionIn'      : 'none',
            'transitionOut'     : 'none'
        }
           );
}

});

</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T12:23:46+00:00Added an answer on May 23, 2026 at 12:23 pm

    I modified the code block to the following and it’s functioning as expected both in Chrome 13 and FF5.

    <script>
    
        $(document).ready(function () {
            var cookieName = 'the_cookie1';
    
            var cookie = $.cookie(cookieName);
            if(cookie === null) {
    
                var cookieOptions = { expires: 3, path: '/' /*domain:, secure: false */ };
    
                $.cookie(cookieName, 'true', cookieOptions);
    
                $.fancybox(
                    '<h2>Hi!</h2><p>Lorem ipsum dolor</p>',
                    {
                        'autoDimensions': false,
                        'width': 350,
                        'height': 'auto',
                        'transitionIn': 'none',
                        'transitionOut': 'none'
                    }
                );
            }
    
        });
    
    </script>
    

    FireFox 5
    enter image description here

    Chrome 13
    enter image description here

    First run, I receive the box and the cookie is set. Thereafter, no box.

    I did notice some strangeness with Chrome where the cookie would not appear in the console occasionally but debugging the script in fact revealed the cookie was set and functioning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please Anyone can tell me why i got this kind of error: ACK=Failure&L_ERRORCODE0=81002&L_SHORTMESSAGE0=Unspecified%20Method&L_LONGMESSAGE0=Method%20Specified%20is%20not%20Supported&L_SEVERITYCODE0=Error
Can anyone please tell why this error? I have included everything ( all header,
Can anyone please tell me how do I make this script run in IE
Can anyone help me with this code and tell me what is wrong? My
Can anyone please tell me if Certifying Authorities (CAs) are allowed to make modifications
Can anyone please tell what is change request management tool and what is involved
Can anyone please tell me why compiling a C# application with a .cs file
Can anyone please tell me when should I use MessageContracts and when should I
Can anyone please tell me is there any special requirement to use either EXTERN
Can anyone please tell me how to move file(s) into a dir in PHP?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.