October 22, 2024
Chicago 12, Melborne City, USA

jQuery

jQuery is a JavaScript library. jQuery is a popular cross-browser JavaScript library that facilitates Document Object Model (DOM) traversal, event handling

jQuery

Why can't I save notes in a multi-entry journal setup using jQuery and AJAX?

I’m working on a web application where users can maintain multiple journal entries on a single page. Each entry allows users to add notes through a Markdown editor. The problem is const notesContent = notesDisplay.find('.markItUp').val(); is returning null when it should be getting the content inside the textarea when clicking save full code: @foreach($notes as

Read More
jQuery

How to get datepicker to show today's date in a new form using php

I’m using PHP 8.2 and datepicker. I have a form. It has two date fields, which both use the datepicker class. When the page loads, the form is empty (new record). But, the date fields default to 1970-01-01. How can I get these date fields to be either: 1) Today’s date (current date) or, 2)

Read More
jQuery

I need to give an element the same class as another element

<div class="topnav" id='myTopnav'> <div class="dropdown"> <button class=" dropbtn">Adobe ▼</button> <div class="dropdown-content"> <a href="index">Photoshop</a> </div> </div> </div> <script> jQuery(function($) { var path = window.location.href; $('#myTopnav a').each(function() { if (this.href === path) { $(this).addClass('active'); $(this).parent().parent('first-child').addClass('active'); } }); }); </script> I am not very good at jQuery or even Javascript, but I would like to give the button

Read More
jQuery

Trigger event when searched term is found jQuery

When a user presses Ctrl + F (PC) or Cmd + F (Mac) in a browser, a search field pops up allowing you to search for a word. If it finds a word, it highlights it on the page. So in the example below, if you search for "pink" it will pull two results, and

Read More
jQuery

jQuery $('CLASS').on('click tap touchstart', function(event) not working on mobile

EDITED AND REPOSTED as the title says, the function is working properly on desktop, but not on mobile. The code is below, but I’ve removed most of it because it’s quite repetitive and long, but if you need the entire script I’m happy to provide it. Thanks! HTML <span id="brxe-wlyncw" class="brxe-button main-cta-button pricing-btn faq-btn bricks-button

Read More
jQuery

php readfile() problem on download content (i read all related posts before send it)

I’m having trouble creating a secure download on my site, it’s not uploaded yet and it’s currently being tested on the xampp server on my PC. It should be noted that my operating system is Windows 11 this is my code: user click on a download link (jquery): $(document).on('click','.downfile',function(e){ e.preventDefault(); var reqfile=$(this).next().val(); $.post('php/downloadfile.php',{ reqfile:reqfile },function(data){});

Read More
jQuery

Solving scope issue while using jQuery ready function

How can I solve this scope issue: I am trying to update an old project. HTML file includes JS file. after some code from the JS is running, it calls back a function myFunc() from the HTML. In the new code, I need to add jQuery ready function to the HTML file. so I get

Read More
jQuery

How to manage JavaScript redundancy in Laravel

I have some common JavaScript functions in my Blade views. What is the best practice in Laravel to reduce redundancy and store these functions in one place? Storing them in app.js and accessing them doesn’t seem to work. For example, I have some JavaScript code inside the tag in the admin.view, and the same code

Read More
jQuery

Todolist: Remove dynamically added divs

I have a kind of todolist, in which I add elements when clicking on the ‘add’ button. There are two default lines. The add function works great, here’s the original code $(function() { $(".container").on('input', 'input[type=text]', function(event) { var i = $(this).closest(".flex-row").index(); var v = (i == 0) ? $(this).val() : "|" + $(this).val(); $("#custom_wrapper .output").eq(i).html(v);

Read More
jQuery

how to disable bootstrap DataTables horizontal scroll

I have this horizontal bar that is completely unfunctional, and it is looking very bad: I was wondering if I could delete it but only using the js in "_MyLayout" file: $('.table').DataTable({ pageLength: 50, pagingType: "full_numbers", scrollY: '300px', scrollCollapse: true }); Also, if it is necessary to use the "site.css" file I have an issue

Read More