[Solved] Display issues on website after selecting language [closed]

You should probably mention what technology you are using for the translations. Also the issue seems to be that you are using a sub-folder for each language. Ex: https://www.hollandmarineparts.nl works but https://www.hollandmarineparts.nl/nl doesn’t. It seems that the routes are broken for when you have a language other than default. (determined from the errors in the … Read more

[Solved] How to get the list elements using jquery? [closed]

$(document).ready(function() { $(“#btn”).click(function() { let url = $(“#url”).val(); $(“#result”).text(`Looking for [${url}]`); let link = $(`a[href=”https://stackoverflow.com/questions/62111716/${url}”]`); if (link.length>0) { let li = link.parents(“li”).last(); $(“#result”).text(`${li.text()}`); } else { $(“#result”).text(`no item found for ${url}`); } }); }); <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js”></script> <div class=”paragraph”> <ol> <li>I want a <a href=”https://www.111.com” target=”_blank”>Chocolate</a><span style=”color:rgb(80, 141, 36)”> Cookie</span></li> <li>I want a <a href=”https://www.222.com” target=”_blank”>Strawberry</a><span … Read more

[Solved] sum of column using jquery [closed]

This is when the “context” of the input that matters: you want to update the sum that is in the same column where the input element was updated. What you can do is: Get the index of the <td> element the input belongs to Calculate the sum of all expenses belonging to the same column. … Read more

[Solved] filling a form with jquery [closed]

Try this HTML <input type=”text” name=”” id=”voornaam” value=”” class=”full” /> <input type=”text” name=”” id=”achternaam” value=”” class=”full” /> <span class=”data-name”>Dhr. name lastname</span> jQuery $(‘#voornaam’).on(‘keyup’, function () { var name = this.value; var lastname = $(‘#achternaam’).val(); $(‘.data-name’).text(name + ” ” + lastname); }); $(‘#achternaam’).on(‘keyup’, function () { var lastname = this.value; var name = $(‘#voornaam’).val(); $(‘.data-name’).text(name + … Read more

[Solved] How do I make two images fade in/out repeatedly? [closed]

CSS Animation Wrap both images in a block element that has: position:relative Set both images to position:absolute Make 2 @keyframes and animation: 10s infinite alternate Assign a @keyframe animation to each image. The 2 properties being animated is opacity and z-index (z-index is only on 2 frames because there’s only 2 states really lower or … Read more

[Solved] How to put HTML, CSS and JS in one single file

you cannot save all the file extension into one single file. Css is .css, Javascript is .js. but you can link all those files into your html <link rel=”stylesheet” type=”text/css” href=”https://stackoverflow.com/questions/47306539/yourcssfile.css”> for javascript <script src=”https://stackoverflow.com/questions/47306539/yourjsfile.js”></script> solved How to put HTML, CSS and JS in one single file

[Solved] Click outside of div and more [duplicate]

$(function() { $(‘#loginBtn, #loginArea’).on(‘click’, function(e) { $(‘#loginArea’).show(); e.stopPropagation(); }); $(‘body’).on(‘click’, function() { $(‘#loginArea’).hide(); }); }); If the click is within the login area or on the button, then the event will not make it to the second handler to hide the login area. solved Click outside of div and more [duplicate]

[Solved] format a 12 digit number in XXXX XXXX XXXX format using javascript

You can use selectionEnd to control the position of cursor var target = document.querySelector(‘.creditCardText’); target.addEventListener(“keyup”, function() { var position = target.selectionStart; var prevVal = target.value; var newVal = prevVal.split(” “).join(“”); // remove spaces if (newVal.length > 0) { newVal = newVal.match(new RegExp(‘.{1,4}’, ‘g’)).join(” “); } target.value = newVal; for (var i = 0; i < … Read more

[Solved] Find piece of string inside array and do something if I can find it

Your question still isn’t explained very well, but I think I have it. You’re asking why this returns true: if($(this).html().indexOf(“Title A”) != -1) { //should get here } But this doesn’t: var titles = [“Title A”]; var realTitle = $(this).html(); if (titles.indexOf(realTitle) > -1) { //should get here } The difference has to do with … Read more

[Solved] Using jQuery deferred and promise inside loop

I think you can do something as simple as this: var sortedArray = [AList, BList, CList, DList]; Promise.all(sortedArray.map(function(value) { var url = …; return getListItems(url); })).then(function(results) { // results is an array of results from AList, BList, CList, DList in order let allJsonData = []; results.forEach(function(approvedListItems) { allJsonData.push.apply(allJsonData, approvedListItems.d.results); }); // process allJsonData here }); … Read more