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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:13:59+00:00 2026-06-16T15:13:59+00:00

I have the following code for my ad system: function showandhide() { if ($(‘.showandhide’).html()

  • 0

I have the following code for my ad system:

 function showandhide()
 {
    if ($('.showandhide').html() == 'show ads')
    {
       $('.showandhide').html("show ads");
       $('.ads').hide();
    }
    else 
    {
       $('.showandhide').html("hide ads");
       $('.ads').show();
    }
 }

The code is very simple. It hides and shows ads in my website. The problem is that it does not store the user preferences. How do I store them? Is there a fast way without using a database? I do not feel like creating a code to store information to my database just for hiding and showing ads. Is there any other fast solutions? maybe something in jQuery?

  • 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-16T15:14:01+00:00Added an answer on June 16, 2026 at 3:14 pm

    If you are trying to store the detail temporarily you can save it in a session. for that you can use jquery ajax..

    $.ajax({
       url: '/update-session.php',
       data:"detail="+detail,
       type: 'post',
       success:function(data){
           // if you care. 
       }
    });
    

    server side

    $_SESSION['pageX'] = $_POST['detail'];
    

    ADDITION

    in order to check if the session variable exists or not

    check this link php Session_id_registered

    and you want to save the session only when you click a button. you can give that by using jquery click event..

    hope this helps!!

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

Sidebar

Related Questions

I have the following code $(#nav-mail).mouseenter(function(){ $(#dropdown_mail).show(); }); $(#dropdown_mail,#nav-mail).mouseleave(function(){ $(#dropdown_mail).hide(); }); and I am
I have the following code in my Register.Aspx View page <div class=FieldDropDown> <%: Html.DropDownListFor(Function(m)
I have the following code: $.ajax({ type: GET, url: AJAX.ashx?job=fetch_calendar, dataType: html, success: function
I have following code in the form_Load function System.Windows.Forms.Timer newtimer = new Timer(); newtimer.Tick
I have the following code: using System; using System.Diagnostics; using System.IO; using PdfSharp.Pdf.Printing; namespace
I have the following code using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace
I have the following code: public partial class queryTerm : System.Web.UI.UserControl { private static
i have the following code: Private Sub TxtPStof_KeyPress(ByVal sender As System.Object, ByVal e As
i have the following code Private Sub select_color_Click(ByVal sender As System.Object, ByVal e As
I have the following code: int a = 0; protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)

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.