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 8983155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:46:04+00:00 2026-06-15T20:46:04+00:00

//minimize latest news window.document.querySelector(#ncWrapper > #nc > #action_ncMinMax).click(); //select location in weather // $(a:contains(‘München’)).click();

  • 0
//minimize latest news
window.document.querySelector("#ncWrapper > #nc > #action_ncMinMax").click();

//select location in weather
// $("a:contains('München')").click();

// check if variable is stored in cookie
var loc = $.cookie('loc_cookie');
if ( loc != null) {
    alert('loc existiert');
    var loc_exists = 1;
}
else { var loc_exists = 0; };

// only ask for location if no location is saved yet [functions inside if work]
if ( !loc_exists ) {
    var loc = prompt("Wählen Sie den Ort für den Wetterbericht?");
    alert('Sie haben ' + loc + ' als Ort für den Wetterbericht gewählt.');
};

    $("a:contains('" + loc + "')").click();

// save to cookie
$.cookie('loc_cookie', loc);
alert('loc in Cookie gespeichert');

Can anyone help me? the var loc = $.cookie('loc_cookie'); seems not to work. I just copy/pasted it and hope you know, what I want to make the js do.

  1. look for cookie -> get cookie and save if it exists
  2. if it doesn’t exist, ask for location || if if does do nothing.
  3. get location.
  4. save location in cookie.
  • 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-06-15T20:46:06+00:00Added an answer on June 15, 2026 at 8:46 pm

    Remove the “var” keyword within the if/else block. By adding it you create a new local variable.

    // check if variable is stored in cookie
    var loc = $.cookie('loc_cookie');
    if ( loc != null) {
        alert('loc existiert');
        var loc_exists = 1;                 <- new instance of loc_exists
    }
    else { var loc_exists = 0; };           <- new instance of loc_exists
    

    Should be

    // check if variable is stored in cookie
    var loc = $.cookie('loc_cookie');
    var loc_exists;
    if ( loc != null) {
        alert('loc existiert');
        loc_exists = 1;
    }
    else { loc_exists = 0; };
    

    Lastly, it might be clearer to use a boolean:

    if ( loc != null) {
        alert('loc existiert');
        loc_exists = true;
    }
    else { loc_exists = false; };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to get the minimize box click event of a WPF window?
How can i Minimize the window to the Taskbar? im using: FormBorderStyle = Windows.Forms.FormBorderStyle.None
When I minimize a window in qooxdoo, where does it go? Is there a
I am trying to minimize the window with the title located in the string
I'm trying to minimize a window to the tray, but it seems it refuses
How to minimize chrome browser to tray when I click on standard minimize button?
Is it possible to minimize the default border of every side of a button?
I am trying to minimize margins around a 1X2 figure, a figure which are
I am trying to minimize the performance penalty of communicating across AppDomains in the
I am trying to minimize the height of the table shown below. Firebug tells

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.