Problems with dropdown calendar in Safari
I have been using a jquery work around for a datepicker which until today has been working perfectly. Suddenly, it has stopped functioning, so that the drop down calendar no longer appears. The code that I have used for the date picker is as follows: <script type="text/javascript"> var datefield=document.createElement("input"); datefield.setAttribute("type", "date"); if (datefield.type!="date"){ //if browser doesn't support input type="date", load files for jQuery UI Date Picker
navigation link clicks hide/show button when loaded ajax loaded
Hi, I currently have click functions for my navigation links to show and hide a button based on what is clicked but some pages load (utilisation) loads via ajax and therefore I need to hide the button until it's loaded. Can anyone help me out here please? Thanks $( "#administration, #history, #vehiclereport, #plantreport, #trailers" ).click(function() { $(".btn-toolbar-image").hide(); }); $( "#fleet, #fuel, #improvingbehaviour, #safety, #report, #summary, #trend" ).click(function() { $(".btn-toolbar-image").show();
clone repeats multiple times if a class but works properly if an id
Hi, I am trying to clone some html after each driver-report-driver class name, this works fine if I target the name as an ID of report_topper_head but it repeats multiple times between if it targets a class of report_topper_head Problem is, I can't have the same ID name throughout my code $("#report").click(function() { $(".report_topper_head").clone().insertAfter(".driver-report-driver"); });
using singleton to replace $(this)
Hi: I hope to implement an singleton to replace the usage of $(this); following is my code snippet jQuery.single = (function (element) { var collection = jQuery([1]); return function (element) { collection[0] = element; return collection; }; }); $('#btnTestSingle').bind('click', function () { var html = jQuery.single(this).next().html(); console.log(html);
Get top style from dynamic content
I'm trying to get a top style that is being applied to dynamic added content and assign to an image. I've built a function w/ Timeout to check if it's parent exists and then get the css(top) value. It's firing now, but I can't assign the top style to the image margins. function addGalleryDone() { var emarck = $('.justified-gallery .pro').first().find('img').css('margin-left'); if (($('.justified-gallery').length) && (emarck != '0px')) { console.log('Galleryload Done');
jquery 3.4 - Replacement examples for deprecated positional selectors (:first, :last...)
Hello, On the 3.4 version, selectors ":first, :last, :eq, :even, :odd, :lt, :gt, and :nth" are marked as deprecated. http://blog.jquery.com/2019/04/10/jquery-3-4-0-released/ But I can't see anywhere examples of functions we should use instead... Can somebody point me out some doc on the subject, or give me some examples, please? For :first and :last, I can use .first() and .last(). But what if I want the opposite, with 'no'' ? Like: var $dom = $('input[name^="field_001_"]:not(:last)'); And what methods
toggle sibling
Hi, I'm trying to show a ul when a h3 is clicked, below is the code I have, hope someone can help: <div class="footer-menus">
<div id="footer1">
<h3></h3>
<ul>
<li></li>
</ul>
</div>
<div id="footer2">
<h3></h3>
<ul>
<li></li>
</ul>
</div>
<div id="footer3">
<h3></h3>
<ul>
<li></li>
</ul>
</div> </div>
<script type="text/javascript">
$(document).ready(function() {
$('.footer-menus h3').click(function()
Uncaught TypeError: $(...).dialog is not a function error in jQuery3.3.1
Hi JAKE, I have the following error appearing in my page using jQuery 3.3.1 Uncaught TypeError: $(...).dialog is not a function at <anonymous>:1:14 at m (jquery.min.js) at Re (jquery.min.js) at jQuery.fn.init.append (jquery-3.3.1.min.js) at jQuery.fn.init.<anonymous> (jquery-3.3.1.min.js) at z (jquery-3.3.1.min.js) at jQuery.fn.init.html (jquery-3.3.1.min.js) at Object.<anonymous> (jquery-3.3.1.min.js) at u (jquery-3.3.1.min.js? at Object.fireWith [as resolveWith]
Ajax form does not execute on success
Hi, I have a form that uses ajax. It is supposed to execute an addclass and append to a div upon success. The code submits the form, but does not execute on success. $("form#mc-embedded-subscribe-form").submit(function(e) { e.preventDefault(); $.ajax({ type: "POST", url: $(this).attr('action'), data: $(this).serialize(), // serializes the form's elements. success: function(data) { $('#newsletterform').addClass('success').append('<div class="thanks">Thanks for Subscribing!</div>'); } }); }); What's
Language switcher is not displaying in Firefox browser with jQuery 3.3.1
Hello, I need your help on this, please. I have an application with PHP, Javascript and jQuery. I have upgraded jQuery from 1.12 to jQuery 3.3.1 version using jQuery migrate plugin. After upgrade the menu worked fine(as I could tested it) but now menu is appearing randomly in Chrome and non displaying at all in Firefox. Debugging app, pausing on exceptions finds this error stack: SyntaxError: '*,:x' is not a valid selector php code: $languageswitcher = ''; if (LANGUAGE_SWITCH && empty($logoutontop)
jquery validation
Hi my name is frank, I need help to solve a validation problem. as I fill up partially my form at the first ok field checking stops, leaving fields unchecked, also event.preventDefault myght be used in a wrong way, thank you, frank
Youtube Integration doesn't show for the first time on my website?
Is this a jquery problem or anything else? As soon as the page open, it doesn't load the video for the first time. Then after refreshing it, its shows. It happens with lot of my pages! Posting the issue below. If you didn't find the issue in the given link, then try someother pages. you'll know the issue!! Here's the issue: https://www.guitaa.com/chords/wttsmy-kucaimars-jawab-acoustic
How do I remove all classes that start with a certain name?
Hello, Im have tr element that have classes assigned to them. There can be any number of classes. How would I remove all classes starting with "itemnx" I have this but I dont believe it'a working. $("tr.itemno").each(function (x) { $(this).removeClass('*[className^="itemnx"]'); }); <tr class="itemno itemnx1 itemnx2 itemnx3"></tr>
Using double and single click.
Hi, I have some problem using double and single click. this is my fiddle: https://jsfiddle.net/tL37zkpe/1/ Thanks in advance Tegatti
Customize the styles in table cells
Hi, I need to change the background color and the color text in tr after calling php file with ajax. It works fine if a insert the number of the row where to change style css. But it not works if I give an index. This is my code with index (i), The value of the variable i is 5 (sure!!): var i = $("#cont").val(); $('#miaDisp tbody tr:eq(i)').css('background-color','green'); $('#miaDisp tbody tr:eq(i)').css('color','white'); and with number (5): $('#miaDisp tbody tr:eq(5)').css('background-color','green');
Manipulation Dom html(html)
how can I get input from a table in html rendered inside another html, function html (html), after rendering I can not get the value inside the input, these values are coming from the database, I see through the browser debug that does not it enters inside my function where it has the method
Hide PDF download button in firefox!
Hi, I hide the PDF download and print button in chrome browser using this code #toolbar=0. It works fine in Chrome browser only. but i need to hide those button in Firefox browser also. so please someone help me!. Thankyou.
selected option in drop down menu checks or unchecks checkbox value
I apologize for the confusing title. In the code below, my goal is to, when an option is selected in the drop down menu, the options class needs to check the matching class in the checkbox array in the next div. So if the first option is selected in the drop down menu (Academic accommodation request), both the first and second checkboxes (Test 1a and Test 1b) need to be checked. I have had success grabbing the title attribute in select options but have not had much luck grabbing selected option
CSS Border Animation
Hi, I have a css border than I am animating around a box. As shown here https://codepen.io/jeremydricard/pen/MdPaRY there are 2 animations. The first one loops an infinite border around the box every 5 seconds in a circle (or square) motion. The second is triggered when the mouse hovers on top of the square. Starting the second animation which just acts like a focus and highlights the square and the first animation is removed. Upon when the box is removed from hover state it should go back to animation
Original html table is inadvertently resized, during a JQuery inline edit.
Hi, We have an html table inside a div container that is sized a certain way, based on the css associated with the div. The rows are readonly. On each row, we have an Edit and Save button defined, with JQuery. Both the Edit and Save are working fine. The problem is, that the table width and the individual column widths in the Inline Edit row, lie outside the boundaries of the original table. Original Row: Inline Edit Row : The original table is defined here, in the php: [CODE] <?php //... $service_table
Toggle click
Hi, I have a sidebar I would like to toggle a click function to show and hide, can anyone please help, I have the code to hide but then I need to be able to click again to show $( ".sidebar-icon" ).click(function() { $("#sidebar-wrapper .list-group").css('width','0'); $(".navigation-warnj").css('width', '0'); });
How to get input text value inside td
Hi, I have an html table with 7 rows and 7 columns that contains input text. I need to get the value of each input and put in array. I've done in this way, but it returns value undefined. var table = document.getElementById('tabOrario'); var rowLength = table.rows.length; for(var i=1; i<rowLength; i+=1) { var row = table.rows[i]; var cellLength = row.cells.length;
How to get all value from my tr
Hi, I need your help to get all data from my table I've tryed this: var table = document.getElementById('miaTab'); var rowLength = table.rows.length; for(var i=2; i<rowLength; i+=1) { var row = table.rows[i]; var cellLength = row.cells.length; for(var y=0; y<cellLength; y+=1) { var valore = row.cells[y]; alert("val ->"+valore) } } the alert shows: val ->[object HTMLTableCellElement] Can someone helps me, please Thanks, Tegatti
calling a function within a .load() ?
some of my javascript is loaded before my dom is loaded and I need to try and get it loaded after the dom is loaded, please help
How i can add animation structure / transition effects with appendto
I would like to know how to make an animated / transition effect more "smooth / ease" in the exchange of the divisions of the appended code. https://jsfiddle.net/h2av6nct/
json ajax call in not firing
i have below code but its not calling mention action method when i put break point ,no error nothing but still unable to figure out issue [HttpPost]
public ActionResult subscribe(string values)
{
DataSet ds = new DataSet ();
ds = ts.SelectQueryDS ("select * from [TBL_USER] where username="+"'"+ Session["user"] + "'");
int id= Convert.ToInt32(ds.Tables[0].Rows[0][0]);
string[] valuesdb = values.Split(',');
for (int i
out of stack space at "Ma" function
hi I am using jquery-3.1.1.min.js There in production environment , out of stack space at "Ma" function. I used application insights to trace the issue. I unminify the jquery and found 'Ma' function and i dont know the usage of that. Kindly suggest me
deferred loading continiously until finish
I have created a simple plugin using jquery that loads the contents by using post request from server. All the info is defined on data-attr on div with name loader[]. It's successfully loading contents. However resulting data may contain more loading div tag. What I'm looking is way that once the first run is finished completely, check again if there are div with name=loader[], if there are any run the loop again and do it until there are no div with name=loader[] are present in body section. I tried
Dumb question - is 1.12.4 acceptable version for new site deployment?
And how difficult would it be to update to 3.4.0 We have web designers putting together new website for us and I notice via Google Lighthouse that the jquery version 1.12.4 which has been compromised in past (recent article as well). Is it a big deal to go from 1.12.4 to 3.4.0? I am wondering whether I should ask the web developer to upgrade it. Have them explain it a very least. Thanks in Advance
jQuery Ajax GET
Hello, I've got a jQuery and Ajax script which loads and parse a CSV file with papaparse. This works great thanks to help from this forum. I've found one problem though on one product page I'm using it which I can't seem to get to work. I've got a select box which you choose between a couple of options and after that the script chooses the right csv file (productCSVname). The first time I choose from this select box it works fine. But if I change the select box which chooses the csv file it dosen't
Fluid width of container based on fluid height percentage (iframe aspect ratio?)
I've been trying to figure this out with css for quite a while now and just can't seem to figure it out. So I'm thinking maybe it's a solution for jQuery. What I'm trying to do is have a vimeo iframe embed horizontally centered that keeps it's aspect ratio based on the height. So I want the width to be fluid based on the height. But the height is also fluid to some extent: Height:100%; Max-Height: 731px; I want to have a box shadow around the video, but with no bars, hence the need for the proper
IF fields contains then alert
I am struggling to understand where I've been going wrong, but what I got is a div that shows a value depending on what the user selects on the previous screen. However despite selecting other one's such as Kerb Drainage for example, it always alerts "access" I've tried having separate IF statements but then they all alert, one after the other. if (jQuery('.product_type:contains("Access Cover")').length <= 0) { alert("access"); } else if (jQuery('.product_type:contains("Gully Grate")').length <=
cycle through tabs
I am trying to automatically cycle through my tab content for a charts presentation I have chosen to use something like this: https://codepen.io/filipemcribeiro/pen/oxXZLr Although my version of Jquery 3.3.1 and bootstrap 4.1.3 only allows it to auto cycle to just the next tab and then stops var tabChange = function(){ var tabs = $('.nav-tabs > li'); var active = tabs.filter('.active'); var next = active.next('li').length? active.next('li').find('a') : tabs.filter(':first-child').find('a');
Script with .includes works fine in Chrome but not IE
Hi, I have a piece of JQuery Script that works fine in Chrome and Mozilla, but does not want to work in IE. I read up on it and it said that IE does not support the include function. So I tried using indexof but that made it stop work in all browsers. What can I use that will work in all browsers? I appreciate any help rendered. function sendCheck() { var valid; valid = validateCheck(); if(valid) { jQuery.ajax({ url: "verify_step1.php", data:'age='+$("#aRange").val()+'&fd='+$("#fdate").val()+'&ft='+$("#ftime").val()+'&td='+$("#tdate").val()+'&tt='+$("#ttime").val()+'&pul='+$("#floc
How to find if div with specific id exists in jQuery
I have this code: $('body').on('click', '#materials li', function () { if($(".appended").length == 0){ $('#materials-form').append('<input type="hidden" class ="appended" name ="Materials[' + $(this).attr('data-id') + ']" value="' + $(this).attr('data-supplier') + '"/>'); $('#materials-form').append('<li>' + $(this).text() + '<button data-id = "' + $(this).attr('data-id') + '">Delete</button>' + '<input type ="text" id = "quantity" name="quantity[' + $(this).attr('data-id') + ']" /> ' + '<input type
Problem with dynamically appended elements
I am creating something like a shopping-cart in yii2 . Here is my code: $('body').on('click', '#materials li', function () { let hidden = $('[value=' + $(this).attr('data-id') + ']'); console.log(hidden); if (hidden.length > 0) { return false; } else { $('#materials-form').append('<input type="hidden" name ="Materials[' + $(this).attr('data-id') + ']" class="hiddenInput" value="' + $(this).attr('data-supplier') + '"/>'); $('#materials-form').append('<li>' + $(this).text() + '<button data-id = "'
Passing in two variables to onclick
I have a PHP script which is looping through a database result. Each row will create a link <a href="#" class="mylink"><?php echo #PHP; ?></a> I'll then have a jQuery, for the mylink onclick even to call a page. On I need to pass into the even two vairbales from my row, an ID, but also a date string. mylink('34, '2015-05-08'); for example, but it's that the syntax for a JS on click even.
HTTP400:INCORRECT QUERY
hello , I have a problem for 3 days on an HTTP request of type $. AJAX {()} I explain my code: the data I have are : headers : Content-Type = application/json body :{ "UserName": "trinita", "Password": "112A" } my request http is: jQuery.ajax({ url: data.npsod.conn.server+'Account/Login', method: 'POST', contentType: 'application/json', dataType : "json", data:{UserName:"trinita",Password:"112A"}, xhrFields: { withCredentials: false }, error:
Calculate mouse position after zoom ?
Hi I'm using a jQuery plugin to create a flowchart, this allows you to create links between connectors. This all works well but I've needed the ability to zoom on the flowchart, so I've used jQuery UI animate zoom and that seems to work fine. When I click on a flowchart connector a temp link is generated that follows the mouse pointer until you click the final connector and the link is made.. Currently the temp link is not in line with the mouse pointer when a zoom is applied. It appears that when
Each event is not firing
I have included a jQuery file in my template, and it loads perfectly. But when I am trying to implement each function, it doesnt fire that event. I am writing some jQuery code for Salesforce Commerce Cloud SFRA. Whereas the same script works for other DOM elements on other platforms like JS Fiddle and Chrome Devtools. This script is provided in a catridge by Paypal, so I just need to integrate the cartridge and it will work, but here I am having trouble because each event is not working. Is there
Next Page