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

  • SEARCH
  • Home
  • 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 969763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:41:45+00:00 2026-05-16T02:41:45+00:00

I use the following jQuery (1.4) code to test whether cookies are accepted: $.get(http://localhost:8080/cookietester/cookietester,

  • 0

I use the following jQuery (1.4) code to test whether cookies are accepted:

$.get("http://localhost:8080/cookietester/cookietester", function(data) {
    if (data == "false")
        document.write("Activate cookies!");
    else if(data == "true")
        document.write("ok");
});

But the browser signals that it doesn’t stop page loading. Google Chrome 5 doesn’t execute the script properly and doesn’t display anything.

Is something wrong with this code?

  • 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-16T02:41:46+00:00Added an answer on May 16, 2026 at 2:41 am

    You can’t use document.write in that scenario (actually I avoid it whenever possible), instead use .append() to add a message to the <body>, like this:

    $.get("http://localhost:8080/cookietester/cookietester", function(data) {
      if (data == "false")
        $(document.body).append("Activate cookies!");
      else if(data == "true")
        $(document.body).append("ok");
    });
    

    Or, you could just alert it:

    $.get("http://localhost:8080/cookietester/cookietester", function(data) {
      if (data == "false")
        alert("Activate cookies!");
      else if(data == "true")
        alert("ok");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following jquery statements but i get error in this function onGetDataSuccess(result)
I'm trying to use jQuery.post() function to retrieve some data. But i get no
I have the following code: (i use jquery) <a href=javascript: onclick=document.getElementById('TEST').style.display = ( (document.getElementById('TEST').style.display
I use the following jquery statements, $(.resultsdiv:odd).css(background-color, #fff); $(.resultsdiv:even).css(background-color, #EFF1F1); $('.resultsdiv').hover(function() { $(this).css('background-color', '#f4f2f2');
I would like to know if I can use the following JQuery function on
I use the following the jquery statements to call my php controller function, it
I have the following code that applies a XSLT style Test.Xml.xslTransform = function(xml, xsl)
How would you convert following code to use only jquery library? <html> <head> <script>
I use the following jquery code to load some date on a specific event
I have tried to use the following code to retrieve the data from the

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.