Is there a way to showcase a lightbox exclusively on the homepage of my blogger blog?

Here is the snippet of code I am struggling with:

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js'/>

     <script src='https://gj37765.googlecode.com/svn/trunk/html/[www.gj37765.blogspot.com]jquery.colorbox-min.js'/>
 <link href='https://gj37765.googlecode.com/svn/trunk/html/%5Bwww.gj37765.blogspot.com%5Dfbpopup.css' rel='stylesheet' type='text/css'/>
 <script type='text/javascript'>
     jQuery(document).ready(function(){
        if (document.cookie.indexOf(&#39;visited=flase&#39;) == -1) {
            var fifteenDays = 1000*60*60*24*30;
            var expires = new Date((new Date()).valueOf() + fifteenDays);
            document.cookie = &quot;visited=false;expires=&quot; + expires.toUTCString();
        $.colorbox({width:&quot;400px&quot;, inline:true, href:&quot;#mdfb&quot;});
            }
     });
     </script>

I am attempting to implement a Facebook-like box on my blog using jQuery. However, I am facing an issue where the lightbox keeps appearing repeatedly whenever a user navigates to other posts or refreshes the page. My goal is for the lightbox to only show up on the homepage of my site. Unfortunately, I lack expertise in jQuery to troubleshoot this problem effectively.

Answer №1

Perhaps it's due to the excessive use of quotation marks. Let's replace all instances of &quot; with simply ". Also, let's change &39; to '.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using JQuery to append an additional column to an HTML table at the end, determined by array information

I've been experimenting with how to enhance an html table by adding a new column of data. The process involves clicking a button, extracting the existing data column in the table, storing it in an array, performing calculations on it, and then display ...

Webpage unable to scroll

Having trouble with scrolling on my webpage and I can't figure out why! The issue is happening when trying to view this page: Within the main file, I have included 2 other php files: <?php include '../../include/menu.php'; inclu ...

Transform two fixed elements into dynamic elements using JQuery

Is there a way to replace two static elements in the table <tr class="item-row"> with data from an ajax call instead of just appending to them? Currently, I am using this javascript line to append: $(".item-row:last").after('<tr class="item- ...

Encountered a 404 error while attempting to build and serve a Vue.js project using 'npm build' in Apache Tomcat

After setting up a Vue.js project, the configuration in the package.json file looks like this: "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": ...

Text remains constant until the mouse hovers over the image

Check out this Example Here is the HTML code: <ul class="img-list"> <li> <img src="http://s11.postimg.org/ynw9rnexf/Cetina_river.jpg" width="360px" height="280px" /> <span class="text-content"><span> Text To Dis ...

Showing the values of selected checkboxes in a select dropdown - here's how!

Link to the jsfiddle : https://jsfiddle.net/a1gsgh11/9/ The JavaScript code seems to not be working on the js fiddle platform. My main concern is that I would like the selected checkbox values to display immediately without needing to submit any buttons. ...

Express 4 app.use not functioning properly

My backend setup is fairly straightforward with a few routes. I prefer to keep the route logic separate from the server.js file, but for some reason, when I make a POST request to the route, it returns a 404 error. In the server.js file: // Import necess ...

Employing a PHP script to periodically replace index.html multiple times throughout the day

Imagine I have a vision of creating a basic webpage where I update a sentence daily about my emotions, replacing the old one every time. An option could be to retrieve the sentence from a database for each visitor, resulting in this page load sequence: ht ...

Unable to establish a connection with Metamask

Looking to connect to Metamask and retrieve the account balance: <!DOCTYPE html> <html> <head> <title>Testing Ethereum with Metamask</title> <meta charset="UTF-8"> <meta name=&quo ...

The initialized Javascript array solely consists of undefined elements, without any of the expected values

I was under the impression that I knew how to declare JavaScript arrays, but in this particular script, I seem to be stuck in an infinite loop of undefined elements within the array. In my code, I define three arrays containing numbers—two with multiple ...

The program encountered an issue: Initialization must be completed before utilizing hooks

I'm facing an issue with my new Next app. I added line no. 6 and now I'm getting an error. Can anyone help me understand why? https://i.sstatic.net/lMKH5.png import Head from "next/head"; import Image from "next/image"; impor ...

Is it possible to modify the color of an input tag in a form when it is selected?

I'm currently developing a contact form for my website with bootstrap. The form automatically scrolls to any unfilled required field when the user clicks submit, and highlights it with a blue border. However, I want the border color to change to red i ...

Tips for storing a string or object in a Firebase database

I'm looking for some guidance on how to save a string or object to the Firebase database using JavaScript. I'm currently trying to do this on codepen.io. Here's what I've attempted so far: // Setting up Firebase app const firebaseConfi ...

CSS GRID: The Default row and column gaps are automatically included

I'm trying to position the images side by side without any gaps using CSS Grid. However, I noticed that there is a default gap between the columns and rows. Here is the code I used: <div class="grid-container"> <figure class="grid_item gr ...

Adding Dynamic Shadow to Bootstrap 4 Card

I've been trying to figure out how I can add an animated shadow effect to a Bootstrap 4 Card. Currently, my Cards are arranged like this: Image of Bootstrap Card My objective is to create an animated shadow around the card similar to the one shown i ...

Troubleshooting login issues with jQuery, PHP, and MySQL data validation

When I send my login information using ajax/jquery to php to search for the user in the database, it doesn't seem to work properly. There might be an issue with the serialize and json_decode functions. Can anyone provide some assistance? Below are sn ...

Can someone help me troubleshoot why the form for my Django LoginView is not showing up on my website?

After spending nearly an hour going through the documentation, I still can't figure out why the LoginView form is not displaying properly. The template seems to be rendering correctly but the form itself is missing from the HTML tags. urls.py from dj ...

Utilizing JavaScript to retrieve input names from arrays

This is the HTML form that I am currently working with: <form action="#" method="post"> <table> <tr> <td><label>Product:<label> <input type="text" /></td> <td><label>Price:<label> ...

Continue with the transaction by utilizing the window.open method

I have encountered a situation where the payment processor providing me with a URL to direct the user. In this scenario, I can define success_url and cancel_url parameters where the user will be directed post payment completion. However, my application ...

Stripping away HTML tags from Image Titles and Alt attributes with the power of jQuery

I am currently working with a client who is utilizing a CMS where the title and alt image attributes are being populated from the title field. In most cases, these titles contain HTML elements such as span and br tags. My task at hand is to remove these HT ...