jQuery scrollTo goess beyond target section
I am using the jQuery scrollTo function to scroll to sections on my website. However, the first click after the page loads, always scrolls beyond the target section but subsequent clicks behaves normal. Any ideas how I can fix this. My code looks like below. $("body").on('click', "#links li", function () { var scrollHash = $(this).attr("class"); $('html, body').animate({ scrollTop: $("#" + scrollHash + " " + "h2").offset().top - 10, }, 1000); window.location.hash =
how to hide submit button unlit all the input,select,textarea is field after filling the value the submit button should be shown . how to do it using jquery???
how to hide submit button until all the input,select are field and after filling the value the submit button should be shown . how to do it using jquery???
Redirect page if not in frame using JQuery
Hello and thank you for reading my topic. I'd like to detect whether or not the current page that isn't the index page is in a frame, and if not, redirect to the index page and then replace a frame with the document originally trying to be accessed. Using JQuery I can detect whether or not the page is in a frame and whether or not the page is the index page just fine: Frameset of index.html: <frameset rows="100%, 0%" frameborder="0"> <frame src="content.html" name="content" noresize> <frame src="audio.html"
how to find an element in a group
Hi, I have multiple element in one div, and I trying to add class after clicking one the elements, and the class on other elements should be removed. It is something like radio button group, there is one element selected each time. How can I do that through Jquery. I attached my code, for example, when seat1 is clicked,the class on seat2 and seat3 should be removed. $("#seat1").click(function(){ $("#seat1").toggleClass("selected"); $("#datepicker-3").toggle(); }); <div class="col-sm-6 mb-3 mb-md-0">
Upgrading from 1.12.4 to 3.5
I ran the migrate script in a simple page. <script src="https://code.jquery.com/jquery-migrate-3.3.0.js"></script> It flagged using $ and to use jQuery. Every tutorial I could find using jQuery 3.5 still uses $ and not jQuery. Must I updated my all my code from $ to jQuery? The other flag on this simple page was to replace .ckick with .on('click', ) $('.trggr').click(function (e) { }); jQuery('.trggr').on('click',function (e) { }); Plus it flagged a things not in my page but in jquery itself, like
Uncaught Error: Syntax error, unrecognized expression
Hello there! For last two day's I'm trying to figure out what is causing the syntax error and would appreciate any help. $("[name='Item.Index']").each(function () { var index = $(this).val(); console.log("index: " + index); //index value is 0 console.log($("[name='EI[0].ItemType']").val()); //outputs correct value console.log($("[id='EI_0__ItemType']").val()); //outputs correct value var t = "\"[id='EI_" + index + "__ItemType']\"";
Certificate Chain Issue
Hi there It seems as though one of the certification paths for https://code.jquery.com has a an expired CA cert. Please see attached screenshot and refer to the text in the red block. Our enterprise firewall is treating this as untrusted and would like to request that you update the chain to include the new CA certificate from Comodo. All works well if not browsing via any firewall but I'm assuming many businesses will be having this same issue as the cert expired over the weekend on 30 May 2020.
JQuery .is( ":visible" ) always returning TRUE
I can't seem to get the .is( ":visible" ) to work. It always returns true. I believe I have followed the correct syntax, etc. Clicking on .heading, toggles the .details class to hide/show. All seems to work fine, except the .is(";visible") always returns true, even when the .details gets hidden and I can clearly see the display:none is there. Maybe something to do with the fact the display property is dynamically changed...? Code is below: <html> <head> <script src="https://code.jquery.com/jquery-3.3.1.min.js"
Calling Function now working
I've got a normal JS function, I'm calling it from a few different jQuery events which is why the code is standalone. The problem is, it's either not working or it's working twice. Here's my code. In DevTools, the class of popup flashes like something it happening however the class is not added to the code. Also when I do a console.log within the togglefunction function it writes two lines every event. No idea why? Any ideas? $(document).ready(function(){ $('.menu-toggle').click(toggleFunction);
Problem adding class to more lines of a form using jquery clone function
I have the following doubt, I am maintaining a form using the php language, it has a method that clones all content, that is, the body of a current row table for each time the user wants to create too many rows, well, this method is written in javascript using jquery. What happens, I added a select to this form and also a function for validating an input field to be required, but the cat's jump is in it, I add a new line, the function copies the current line and creates another one below, right,
Detect if HTML5 audio is playing using JQuery
Hello and thank you for reading my topic. I'd like to detect whether or not the HTML5 audio tag is playing, and control it across every page from within a frameset. Using JQuery I can control the audio like this: Frameset of index.html: <frameset rows="100%, 0%" frameborder="0"> <frame src="content.html" name="content" noresize> <frame src="audio.html" name="audio" noresize> </frameset> content.html, for our purposes this isolated code and the styles are loaded on every page: <style> .play { display:
Jquery Supported Browser Versions
On the main webpage for jQuery, it states that the current versions for Chrome, Firefox, Edge, and Safari are all supported by the latest jQuery version. It also states that the previous major version is also supported. What does this mean when there are different version numbers for different operating systems? For example, Chrome's most recent major Android version is 85. However, the most recent major Linux version is 84. Before that, both Android and Linux were updated in version 83. Does this
(URGENT) Which JQuery version compatible with Joomla 3.9.15
Dear Sirs, My Website under Joomla 3.9.15 have an alert by Acunetix Scanner as below comments. Would you mind suggest us which version of Jquery.min.js is compatible with Joomla 3.9.x Thanks indeed Fion
How to convert a CSS background property into foreground?
Assume I have a CSS background key similar to .logo { background: url(/static/foobar/mylogo.jpg) 0px -no-repeat; } Is there a way to convert this background property into a foreground image by jQuery? All other configurations (margin, padding, background-position-x, background-position-,....) should remain untouched or converted accordingly. Thank you Peter
slideDown() action based on class of radio button selected?
I need to have a text box appear using slideDown when a specific radio button is checked. Should I do this based on the ID or class? I simplified the form to just the essential piece. I know I need to do something like this but I'm not sure how to trigger a check when the button is checked and to hide the "source_other" box when it is unchecked again. I'm also sure my code grammar is bad. if(source("source_2").prop('checked', true)) { $('#source_describe').slideDown(); } <form name="registration"
Money format every 3s
Hi, I am newbie. Please help me this: The idea is to change the content within <money>123456789</money> to currency format every 3 seconds. And this is my jquery: window.setInterval(function(){ $('money').each(function () { var item = $(this).text(); var num = Number(item).toLocaleString('en'); $(this).text(num); }); }, 3000); The first executing is fine, the content turns to "123,456,789", but from the second executing, the content changes to "NaN". So please
Monetary value collection
Hi, I want to collect values in Turkey money format. For example 5.324.082,10. The codes below do not collect. How can i do? Greetings, Metin. document.addEventListener('DOMContentLoaded', function(e) { $("#prjProjeEkleOzKaynak, #prjProjeEkleDisKaynak").keyup(function() { var sayi1 = parseFloat($("#prjProjeEkleOzKaynak").val()); var sayi2 = parseFloat($("#prjProjeEkleDisKaynak").val()); var toplam = parseFloat(sayi1+sayi2); $("#prjProjeEkleToplam").attr("value",toplam); }); });
How to delete all <div> which contain only whitespaces+empty nested elements?
How can I remove all <div> elements which contain only whitespaces and nested empty elements? Example. The following <div> elements with class="foobar" should be found and removed: <div class="foobar"> <div> "blank"<br>"blank"<br><br> </div> <p> </div> "blank" in the example above should obviously not mean the text "blank" but the correspondig char
AJAX/Fetch Auto Complete from massive DB
I have a database or world cities, over 3 million rows. I want users to search for a city and for them to click a city of choice and obtain the database row number. I can't just list all the rows due to the size so was going to do a ajax type call after a user enters a minimum of 4 chars. I may however need a Search button so I can't call it on the 4th, 5th and 6th letters. Here's what I have which works but is slow. Are there any other ways of doing this? $("#txtSearch").keyup(function(){ var search = $(this).val();
JQuery License and Commerical Use License
Merhaba, benim adım Anil. Ben bir Arayüz Geliştiricisiyim. Ticari bir projede jquery-slim kullanıyorum. Bu proje bir web sitesidir. Kaynak dosyaların içinde jquery.slim.min.js adlı bir dosya var. Bu dosyanın içinde (c) JS Foundation ve diğer katılımcılar | Jquery.org/license * / ifadesi vardır. Ticari kullanım için kullanabilir miyim? Örnek Resim:
get data from combo box and store it to the session
hello, im just learning jquery and ajax via YT, and i tried to create a form with combo box, and show records from database based on combo box after that, i want to store the data to the session i already created the form that showing the records and already worked, but the button that i created that for store to the session, the ajax is not working. ajax3.php (index) <form action="cari.php" method="POST"> <select name="kamar"> <option value="regular single">Regular Single Rp 99.000</option>
live form check availability
hello, i'm newbie of jquery and ajax, so i created based on website that i read i already created simple live username check (and others) and i works but after i implement on to my project, it dosen't works, why? here the code: form code <form name="daftar" method="post" onsubmit="return validate_daftar()"> <div class="form-group"> <label for="username">Username :</label> <input type="text" style="max-width:90%;" class="form-control" name="id_daftar" id="id_daftar" placeholder="Masukkan Username Anda" maxlength="16" autocomplete="off"/>
Do something different based on multiple different URL parameters
I have the following script started and need to trigger certain modals to open on page load, based on the URL string. For example, if 'src' is equal to '123', then modalBuyer needs to appear. If 'src' is equal to '234', then modalSeller needs to appear. Here's what I have so far. This was created back when there was only one modal that ever needed to be shown on page load. if (window.location.href.indexOf('src=') > 0) { $(window).on('load',function(){ $('#cModal').modal('show');
Faster Lookup code
Perhaps more JS than jQuery but looking for a faster option than a long if else statement code. Perhaps easier to manage. I have a menu system which depending on the ID if the list item clicked calls a ajax page. Here's how I'm managing it now Is there a way I can do it where I just maintain an index of ID's and pages? $(document).ready(function() { $(".menu-li").click(function(e){ if ($(this).attr("id") == 'my-btn'){ $.ajax({url: "page-content/mypage.php", success: function(result){
Using load() in a page to add other html to page.
I am creating a project that is HTML and JQuery/Javascript only. I have used the load() and it does show up on the page. However the added page uses a javascript or javascripts files that are loaded on the index page. It appears that the added page cannot use the loaded script. It works fine if i use it on the index page directly. I am only using div tags with special objects in the tag that the javascript looks for. Am i to assume that when you load() a page into another it really isn't part of
I get the error: "SyntaxError: expected expression, got '&'", What is the root cause of this? I don't know what to do
Hello, I'm building with PHP an HTML string and then I want to put it in the html of the div (On this moment I don't know anymore how this called, sorry): jQuery('#searchresults').html(<?php echo htmlspecialchars('<table id="table_id" class=""><thead><tr><th></th><th></th><th>voornaam</th><th></th><th>Achternaam</th><th>Volledige naam</th><th>Categorie</th></tr></thead><tbody>'); ?>); I have bring it back to just a simple hardcoded string. In my console.log I get the message: SyntaxError: expected
What is the different between een Array and this?
Hello, As early mentioned I try to understand and learn jQuery becaus I'm busy for a joomla component. I have read a joomla example and there was this used: return { minlat: latlngMapbounds[1], maxlat: latlngMapbounds[3], minlng: latlngMapbounds[0], maxlng: latlngMapbounds[2] } I thought ok, that's an array on a strange way implemented. So I thought for my implementation I do not so difficult, I will return a 'simple' array. But than it doesn't work. So I made
Why is the behavior differtent between these two lines?
Hello, I try to learn/understand jQuery and I'm using it for creating a Joomla component. I have create an event like this, which should react on "keyup" if something is done in text input element: jQuery(".filter_field").on("keyup", filter_data); //or the next line //jQuery(".filter_field").keyup(function(){filter_data()}); I have two text input elements and one select element with the class="filter_field" The strange thing is, it is only fired the first time if I changed
Table Rows Toggle
I have a table with multiple rows (<tr>). I have 3 types of rows. Two being headers identified by class Year and Month. The 3rd type is just data. Essentially it's like a TreeView but stored in a table. When a user clicks on a Year I want to toggle all other years and just show this one. Same with months but inside that year only. Any ideas?
Internet explorer refuse to run jquery-3.3.1.slim.min.js
Other browsers have no issues running the html/javacsript page. But, internet explorer refuses to run the java script, and it is giving a message "Unable to get property 'createElement' of undefined or null reference. (2,7189).
Is it possible to combine two different element types, handling the same function?
Hello, I have an element type Input and an Select like: <input type= "text" class="filter_field" id=filter_anam" name="filter_anam" value="filter op achternaam"> <select class="filter_field form-control" id=filter_catg" name="filter_catg"> I have created for each a jQuery function which is working: jQuery('.filter_field').keyup(function(){ filter_data(); }); And jQuery('select[name=filter_catg]').change(function() { filter_data()
AJAX Not running
I have a main.js file attached to my index.php page. I load my contend via AJAX into my index.php page. I load a page via ajax which works. On this loaded page I want to call another AJAX script. It get Started and End in my console log but AJAX does not work Why? $("body").on('click', "#acceptQuote", function(e){ console.log('Start'); e.preventDefault(); var q = $("#quantity2").val(); var i = $("#ID").val(); var p = $("#offeredPrice").val(); $.ajax({ url: 'scripts/acceptquote.php',
Uncaught Error: Syntax error, unrecognized expression: #
Hello everyone, I'm using jQuery v3.3.1 and I have a drad and drop function that is giving some users an error which i can't replicate. The html: <div id="target-2" class="dndS-target target-2" ondrop="dndSimpleDropTarget(event);" ondragover="dndSimpleAllowDrop(event);" data-id="2"></div>The Javascript in question (until the line where the error is called): function dndSimpleDropTarget(ev) { ev.preventDefault(); var data = ev.dataTransfer.getData("text"); var here = parseIfInteger($('#' + data).data('id'));
append is nesting divs when it shouldn't
When I do something like $(".something").append($('<div class="aaa" /><div class="bbb" />')) the bbb div gets rendered inside the aaa div instead of them being siblings. Am I doing something wrong? It used to work but we've just upgraded to use the latest version of JQuery and it's stopped working.
totally bizarre problem
hello - i am having trouble getting a jQuery jqwidget app working for one specific customer. its as if the underlying jQuery is being blocked somehow. This simple example is only using a jQuery drop-down combo-window. we tested it on Edge, Firefox, and Chrome on two separate computers. and right-click on the element does not show any console errors. it behaves as if either the router or cox-cable at this particular location is somehow "blocking" the left-click to work! my next guess is to have
Using selectors to find children <th>
My goal is to find those tags with a class of .ht_nestingParent and then add a blank table row above the .ht_nestingParent and then a blank row under the last of it's children rows; which are the rows below that lack the .ht_nestingParent class. Here is my HTML <tbody> <tr> <th class="ht_nestingLevels ht_nestingParent"><div class="relative"><span class="rowHeader">1</span> <div class="ht_nestingButton ht_nestingCollapse"></div> </div></th> <td class="">7-ELEVEN</td> <td class="">22971161</td>
jquery not firing after form submit with ajax
Hi, The code below works GREAT on form page load and typing into "test_field". The number of characters left display correctly in "display_char_left" So all is good until AFTER the form is submitted. After saving the form, ajax is used to refresh page (save data) and display form again with the same field data. Now, the countChar() is never fired again. How do you make the countChar function continue to execute/work AFTER saving the form, when ajax is used to refresh the page? thanks <script>
$.when it doesn't work.
Hello: I have the following code: function LoadTiposIva() { if (TiposIva.length == 0) { //ajax function for fetch data $.ajax({ type: "GET", url: '/FacturasENet/GetTiposIva', success: function (data) { TiposIva = data; console.log("1", TiposIva) } }) } } function resto() { renderTipoIva($('#TipoIvaId'));
Getting selected value
How do I get the selection option using jquery from a table where the last celle contains something like <td> <form action="" method="post"> <select name="moderation"> <option>offline</option> <option selected="selected">online</option> </select> <label>Delete: <input type="checkbox" name="delete" value="delete"></label> <input type="submit" value="update review"/><br /> </form> </td> I need something like $(".data tr td form").each(function(){
Pass variable from get into ajax
I'm trying to check if a file exists and if it does set a variable (furl) to a string and if it doesn't to another string. Furl isn't being found after the get runs. How do I get the furl value into the ajax ? var curprotocol = window.location.protocol + '//'; var curhostnm = window.location.hostname; var curpath = window.location.pathname; var curlseturl = curprotocol + curhostnm + curpath + 'includes/setsacookie.php'; console.log('CurSetUrl: ' + curlseturl); $.get(curlseturl) .done(function()
Next Page