SitePoint Forums » JavaScript
960 FOLLOWERS
This forum category is dedicated to discussions of JavaScript and everything related to it. Learn how to use the language plus the numerous libraries and frameworks that are based upon it, discuss FormData and Ajax Problems, and more.
SitePoint Forums » JavaScript
1d ago
Hi everyone!
I will show you with image.
These codes pull the Tags to the left of the topics.
But every time I click on the logo I get an error.
<script>
function moveTagsToTitle() {
const mainLinks = document.querySelectorAll('.main-link');
mainLinks.forEach(mainLink => {
const discourseTags = mainLink.querySelector('.discourse-tags');
const titleElement = mainLink.querySelector('.title');
if (discourseTags && titleElement) {
const tags = discourseTags.querySelectorAll('.discourse-tag');
tags.forEach(tag => ..read more
SitePoint Forums » JavaScript
3d ago
How can I make the ddChild dropdown conditionally required and its selected value should not be the initial value(which is value=“”), but only if the ddParent dropdown’s selected value is 3, using the jQuery Validation Plugin.
<form id="myForm">
<select name="ddParent" id="ddParent">
<option value="">Please select</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<select name="ddChild" id="ddChild"> ..read more
SitePoint Forums » JavaScript
3d ago
I have a JSFiddle here and I am wondering why the selection is not getting cleared or basically switching to -No Selection- option when Clear Selection button is clicked?
2 posts - 2 participants
Read full topic ..read more
SitePoint Forums » JavaScript
6d ago
There is a timer that appears on the screen after clicking .exitA, 1st button.
I want the timer to start after that button is clicked.
https://jsfiddle.net/87jvr3uh/
Right now, it stops after that button is clicked.
<h2>Click anywhere to stop the timer</h2>
<p id="timer"></p>
<script>
let seconds = 0;
let timerId = setInterval(updateTimer, 100);
function updateTimer() {
seconds += 0.1;
document.getElementById("timer").innerHTML = seconds.toFixed(1) + " seconds";
}
document.body.addEventListener("click", function() {
clearInterval(ti ..read more
SitePoint Forums » JavaScript
6d ago
Hi,
I use a program like companion bitfocus for use a streamdeck xl with lighting software.
Now I have a problem that companion BPM beats per minute signal send to my lighting software. I use the BPM from another software. I would like to turn BPM signal off from companion bitfocus.
I read on companion the i have to edit a javascript index file. I try a lot with notepad ++ but every time the program crashes. Can someone help with with this script? Will be nice! Thanks before
1 post - 1 participant
Read full topic ..read more
SitePoint Forums » JavaScript
1w ago
I have this function seriesSteps, during page load this is called, it will execute all steps,
the display is dynamic loading page where I have div to load that page,
I have button to “goTo” what I want if the current step is executed example showLogs(2) , then I want to click the goTo button
and I want to specify what steps I want to execute, example readMessages(3) when readMessages(3) is executed after it is done, I want all the remaining steps will be executed like await showBlockList(3); until go down to doneProcess()
Is this possible ?
async function seriesSteps(){
await display ..read more
SitePoint Forums » JavaScript
1w ago
I have the following code in JavaScript.
'use strict';
document.body.append(document.createElement('textarea'));
document.body.append(document.createElement('button'));
let btnClick = document.getElementById('button');
function inClick() {
let str = 'abc';
console.log(str);
}
btnClick.addEventListener('click', inClick);
I am getting the following error when execting this script.
Uncaught TypeError: Cannot read properties of null (reading ‘addEventListener’).
I am unable to add an event listener when the button is clicked.
2 posts - 2 participants
Read full topic ..read more
SitePoint Forums » JavaScript
1w ago
Hi,
Does anyone know how to bypass the iPhone Safari 5MB Web cache limit?
Game tested on iPad (9th gen) and works without issues.
You can play the current stable build below:
https://jesseleepalser.itch.io/t-crisis-v
You can view/download the entire source code project below:
https://bitbucket.org/jesseleepalser/t-crisis_v_firefox_110percent_ai/src/main/
Any help would be greatly appreciated, thanks!
Jesse
1 post - 1 participant
Read full topic ..read more
SitePoint Forums » JavaScript
1w ago
i want to perform these tasks on datatable Initialisation
How can i remove class to all td
i have tried to do this
$('td', row).removeClass('dtr-control');
but not working
also i tried to change the div of this dtable_wrapper
to this <div > but not working
<script type="text/javascript">
$(document).ready(function() {
$("#detail").dataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "scpp.php",
"type": "POST",
"dataType": "json"
},
rowCallback ..read more
SitePoint Forums » JavaScript
1w ago
I don’t know if JavaScript is the right category.
I expect to show a button that links to a new html page.
The page will show an overlay of text in the upper left corner, which are easter eggs for the image.
Below that is the image containing the easter eggs filling the browser window.
I’d like the visitor to be able to shift the image around so they can look for the easter eggs listed. The image will be larger than the broswers window in most cases (3000px wide). Some of the detail is small, that’s why the image is so large. Of course, this is only for desktop, and will be used on an internal ..read more