Skip to main content

Posts

js and css are not applied to html as static files of nestjs backend solution on nginx server (localhost works correctly)

Hello dear dev community. i would appraciate your help with complex issue related to static content (html, css, js) and nginx configuration. I have backend solution with nestjs framework that returns to frontend some static content (html, css, js). When I launch it locally localhost works correctly. But after deploy to server with nginx configuration I faced with issue: css styles and js scripts are not applied to html. Could you please advise what would be the possible fixes of this issue. Via Active questions tagged javascript - Stack Overflow https://ift.tt/wQKps2r

Content Overflows Other Sections

I'm a beginner to all of this coding and simply trying to build my store's website from scratch. I've learned a lot in HTML codes so far, and have come across this tab content style that would benefit many of our pages. Unfortunately, I can't seem to find a way to get around the fact that the code doesn't build a frame around the entire content style that is submitted, so when I submit this code to the site and attempt to add a new section, the tab code overlaps the new section. It looks like the frame only goes around the text content, and stops when the <div class="tab"> starts. For reference: see the image attached of the code submitted to the webpage with the content overlapping on the new "TESTTEST1212" text section. Code Submitted with overlapping "test" section See HTML Tab Content Section Code Below: <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, ini

Javascript filtering several options at the time

I am using react to create some page that requires a filtering menu. I have a dogs array which contain every dog information, and I am trying to filtering by its temperaments. every dog has at least three temperaments, and I have been trying to check if they have at least one of the temperaments submitted in the filter menu. But nothing seems to work. This the controling component. import {useEffect, useState} from "react"; import {useDispatch, useSelector} from "react-redux"; import {filteringDogs, getTemps, onSearchBreed, orderAscendingDogs, orderDescendingDogs} from "../store"; import styles from "./styles/SideBarComp.module.css"; import {useForm} from "../hooks"; export const SideBarComp = () => { const dispatch = useDispatch() const { dogs } = useSelector( state => state.dogs ) const { temps } = useSelector( state => state.temps ) useEffect(() => { dispatch(getTemps()) }, []) const { bree

How can I get bookmarked hash links to work with a jQuery change function?

What's the simplest way with this jQuery change function to enable bookmarked hash links to work, i.e to be able to use example.com/#theme1 or example.com/#theme2 links? The jQuery #theme-selector changes the hash and shows/hides the relevant divs with the class, i.e. .theme1 or .theme2 , but when going to example.com/#theme1 from a bookmarked link, all divs are shown. In addition, if I refresh example.com/#theme1 , the hash remains #theme1 , but all divs are shown. Some other questions on SO deal with bookmarkable hashes, but they're many years old. And some libraries that appear useful are ten years old, too, like https://github.com/asual/jquery-address Unfortunately, running the snippet here won't show browser hash changes, nor will JSFiddle. Any ideas? jQuery(document).ready(function(jQuery){ jQuery("#theme-selector").change(function () { var urlhash = document.getElementById('theme-selector').value;

npm install takes forever when running docker-compose

I am working on a Next.js project with a PostgreSQL database running in a Docker container. My project's setup uses Docker Compose. However, when I run docker-compose up, it takes forever to execute the npm install command. Running npm install locally on my development machine finishes in less than a minute. In the attached log, you can see that when I run npm i with the log level set to verbose, it appears to hang with no progress after a certain point. [+] Building 3624.4s (7/8) => => transferring context: 34B 0.0s => [internal] load metadata for docker.io/library/node:latest 1.5s => [internal] load build context

Is this the valid json file format? I couldn't read it using json.parse unless I change it suffix from .json to .js [closed]

users.json const userContent = ` [{"id":1,"user":{"firstname":"Jacquette","lastname":"Marion","email":"jmarion0@nyu.edu","address":"207 Ryan Avenue","city":"Lubbock","state":"Texas","zip":"79491"},"portfolio":[{"symbol":"NKE","owned":483},{"symbol":"NKE","owned":512},{"symbol":"K","owned":562},{"symbol":"GE","owned":288},{"symbol":"PSX","owned":465},{"symbol":"FDX","owned":263},{"symbol":"AAPL","owned":688},{"symbol":"NFLX","owned":828},{"symbol":"NFLX","owned":-211},{"symbol":"APC","owned":994}]}, {"id":2,"u

Issues faced when trying to render two PDF files

I am trying to code a program that will take in two files: a question paper and an answer paper. The two files should be rendered in the same window and have a vertical scroll bar that can be used. Below is my code: import tkinter as tk from tkinter import filedialog from tkinter import ttk from tkinter import * from PIL import Image, ImageTk import os from pdf2image import convert_from_path class PDFViewerApp: def __init__(self, root): self.root = root self.root.title("PDF Question Cropper") self.frame = ttk.Frame(self.root) self.frame.pack(fill="both", expand=True) self.question_file = None self.answer_file = None self.question_label = ttk.Label(self.frame, text="No question file selected.") self.question_label.pack() self.select_question_button = ttk.Button(self.frame, text="Select Question PDF", command=self.select_question_pdf) self.select_question_but