JQuery not working with Kickstarter Comments
I'm trying to remove the trolls at will. I've used this code on many different sites with no problem. I suspect it has something to do with the funky way Kickstarter is loading the comments. I'm using User Scripts with Firefox. // ==UserScript== // @name Kickstarter // @namespace https://www.kickstarter.com/* // @include https://www.kickstarter.com/* // @version 1 // @grant none // @require https://code.jquery.com/jquery-1.10.2.js // ==/UserScript==
having trouble with events on dynamically added objects (again)
Again I'm struggling with events on dynamically added elements. is there something I'm missing? The code works fine for elements that exist on startup.. $(".product-like-wrap").on("click", ".symbol-circle", function () { C.Ajax.Invoke(null, "Api", "LikePicture", { id: id }, {}, "POST", function (data) { let $wrap = $caller.closest(".product-like-wrap"); $($wrap).find(".check-symbol").removeClass("hide"); $($wrap).find(".symbol-circle").addClass("hide"); $($wrap).find(".exists
force use of enum
hi! is it possible to force the use of an enum as method parameter? I don't know how to do it without type description. something like: function (myEnum param1) { } -------------- Just so we're clear - you need a hero?
How to select an option row in a datalist without using the option value ?
Hi, I've found something usefull in a forum to select an option row in a datalist but unfortunatly, it works only if the option value is unique. For example, It does not work for this list: <datalist id="myfriends"> <option value="John Doe" data-id="0"> John Doe is living in Vancouver <option value="John Doe" data-id="1"> John Doe is living in Paris</datalist> Please see my example and this code here : https://jsfiddle.net/peter45/Lnuqxt9o/ Thank you for your reply.
Joomlart.com Corona Template Conflict With JQuery
In The Name Of GOD, Hello, When we use the JQuery Library with Joomlart.com Corona Template , The Homepage menu does not work anymore. What I should do ? Please help us .
ccan not collect form values, and make an object our of it so i can use ajax for submission after stringifying it
Hello guys i really seek you advise and help on the code below. as i have made a form and am using ajax to submit data collected from the form by jquery into the database, i decided to collect form elements values then create an object with the values, so that i can turn the created object by stringify() function so i can pss the object converted string as a text using the ajax function, and the use php json decode to turn back the string into object in php and then work with it from there to be
Data Ratio
Does anyone know how to determine this value? Or how this works? <div class='slide template1' data-ratio='1.44' data-background='#fff'> <img src='gallery/filename.jpg' width='1500' height='1000' alt='' /> </div> Changing this value alters the image dimensions, I've determined. I'm referencing a page that has these files linked in it: <script type='text/javascript' src='http://code.jquery.com/jquery-2.1.1.min.js'></script> <script type='text/javascript' src='http://code.jquery.com/jquery-migrate-1.2.1.min.js'></script>
jQuery Autocomplete - AJAX Data
Hello, I have this code from an open source application that returns data from an AJAX request into an autocomplete field. This is the code: // set autocomplete to customer type fields $('#SearchInsert').find('.CustomerCompanySearch').each(function() { var InputID = $(this).attr('id') + 'Autocomplete'; $(this).removeClass('CustomerCompanySearch'); $(this).attr('id', InputID); $(this).prev().attr('id',
How to delete multiple rows of a table with Jquery and ajax?
I want to be able to delete checkbox-selected rows but when I click on "Delete Selected", but I have the following limitations: 1. Can only delete the first row no matter which checkbox I tick 2. Deletion only take place the first time or if I refresh the page. I want to be able to delete selected rows, and delete them whenever I please without having to refresh the page. datatable.php <a type="button" class="delete_all btn">Delete Selected</a>
<script type="text/javascript">
$(document).ready(function($)
{
function
Show image based on number then reset when total reached.
Hi, I'm new to jQuery and I'll probably be hanging around these forums quite a bit . I'm building a website that will log how far individual people have walked then add all individuals together to get a total distance. I'd like to be able to represent this total as distance around the UK. To test I have to code below. This works but what I'd like to do is when the uk_distance has been reached set times_round_uk to 1 and start the images from the beginning but keep adding to the Total distance and
Conflicts with Jquery 1.5 and Jquery 3.3.1
Hi, I am using different versions of Jquery at my system and I must have to use the both, because I am working with a complex system. I have an example below about my problem. I must have to make them work together. Can someone help me? -- versionamento.html <html> <head> <title>My test</title> <script src="js/jquery-1.5.js" type="text/javascript" ></script> <script src="js/jquery-3.3.1.slim.min.js" type="text/javascript" ></script> <script src="myscript.js" type="text/javascript"></script> </head>
Dynamic looping div
Hi, apologies for asking for help on my first post I'd like to automate the code below so that I don't have to manually add a new function each time. I have a div with a class team, within the team div there is an hours class that increments by 1 every time. individual_sum1 = 0; $(".team .hours1").each(function(){ value1 = $(this).data("distance"); individual_sum1 = individual_sum1 + value1; $(".team .individual_hours1").text(individual_sum1);
Form Tag As Base Selector
Say I've created a jQuery reference to a form tag ($formRef), and within the form I am dynamically adding and removing DOM elements. Will these selectors, a & b, reference the same element? var a = $formRef.find('#elementAddedPostFormReferenceCreation'); var b = $('#elementAddedPostFormReferenceCreation'); I've always believed that with dynamic HTML, the DIV containing the dynamic content should not be cached because it will only 'find' the elements that existed when the reference was created. But
Migrating Jquery v1.5 to v3.3.1
Hi, I am a webmaster in Brazil and I am working at a System that uses Jquery v.1.5 . I am using bootstrap so I have to migrate my system to a new version of Jquery. Cuz we have to have the best perfomance and the new version. But the JQuery have a lot of conflicts with the old version because of the functions at the list "deprecated". I am not sure what is the best option now: Make a new code or try to migrate all the old one. Example of function that I have so much here .live(); that I have to migrate
jQuery move focus to next input
I have a form that contains multiple inputs on different levels. Is there a jquery function that can simulate the pressing of 'TAB' key? I tried using next or nextUntil but none simulate the 'TAB' key because they only go on the same level and not go to the upper levels.
JQuery version (3.3) officially not supported. Instrumentation active nonetheless, because major version is supported and minor is newer than supported versions
Team, We are using Jquery version 3.3.1 for our website. We also load external libraries like analytics.js & SAP_IDs.js(from sap cloud identity). When these libraries are loaded in the page load increases and our monitoring tools show "JQuery version (3.3) officially not supported. Instrumentation active nonetheless, because major version is supported and minor is newer than supported versions" as warning against each external api requests. Could you please tell me what is the issue when external
Reverse Infinite Scrolling Inside Div (Like in a Chat Window)
I'm looking to create reverse infinite scroll inside a div; for a chat application that I'm building. The newly created chat messages are appended below the current stack of loaded messages. However, if the user has to view the old chat messages, they'll have to scroll up. I'm wondering how to do this inside of a `<div>`; and trigger an event when the scrollbar is say 300 pixels away from the top border of the div. After searching a bit, I found out that this is the recommended approach - $('.yourDiv').scroll(function(){
remove one of the comma separated values in a cell while placing row data into variable
Hi all I am working through the tutorials here: https://www.tutorialrepublic.com/faq/how-to-add-remove-table-rows-dynamically-using-jquery.php I have modified the table so it has 3 columns. Here : http://jsfiddle.net/14ngdcuk/ I am now able to collect the row data into a variable Eagle 2018-09-25 12:00,1537876800 predator But I would like only the UnixTimeStamp (eg 1537876800) value of t comma separated datetime value cell in my final variable like so : Eagle 1537876800 predator How and when should
How to match #id patterns with wildcard?
Assume I want to addres all ids which match the following pattern: #advert-* e.g.: #advert-43256 #advert-54 #advert-888 How can I achieve this with jQuery? The following does not work: $("#advert-*")......
How do I blackout part of the page after a certain time
After a person visits the page and starts watching the video When thirty seconds are passed, the entire page about the video is blurred I would be very thankful if I got a small part of the idea
Using replaceWith
Hello all, please consider this code snippet, which works fine: ld: function ($t, $h) { //load HTML of target selection into DOM var $c = $h.clone(); $c.find("script").remove(); //prevent double firing of scripts $t.html($c.html()); //inject div into primary DOM } I would like to tranpose the last line to use replaceWith() instead of html()
Detecting when a combo box field in a table's column change
Hi I have a table where one of its colums whose name is 'color' is a combo box ,the combo box displays two values 'black', 'white'; what I need is to update a counter each time the user changes de value of any combo box on any row of the table from 'black' to 'white', if the initial value of a combo is 'white' and it changes to 'black', counter must be incresed other way decresed. How can I do it ?, I would like to use the id attribute of the field to do that. I have done that in a simple combo
Append values in dropbox list with apostrophes
Hi guys, I am populating a dropdown box with values received from a query (using ajax json mysqli). All works fine until data is found with an apostrophe in it. Then the dropbox is completely empty, although some data have no apostrophes. Can someone help me out here? I suppose the code in red needs to be altered so that data with apostrophes will show in the dropdown box. Many thanks in advance! Here is my code: function getThuisploeg() { seizoen = $("#Seizoen-text").val(); competitie =
Syntax error in IE 11
Hi there, My code works just fine in Chrome and Edge but in IE 11, I get syntax error at line var GDN. Any idea why? $('#Edit').on('submit', function () { var GDN = $('#FirstName').val().split('|').filter((i) => i.length).length; }); Joe
parameter values not passing in jquery ajax method
Hi All, My application has a draggable table following is the code $("table#pages tbody").sortable({
items: "tr:not(.home)",
placeholder: "ui-state-highlight",
update: function () {
var ids = $("table#pages tbody").sortable("serialize");
var url = "/Admin/Shop/ReorderCategories";
console.log(ids);
$.post(url, ids, function (data) {
});
Jquery autocomplete using a remote data source
Hi All, I'm trying to implement Jquery autocomplete using the remote data source (https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/advanced-options/metadata/icons.json). I'd like to search in the terms array as shown below and return all the objects containing the search term in the arrays. I tried this code but it's not working. Do we need to implement the data soruce on the server side or will it work with this URL data source (https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/advanced-options/metadata/icons.json).
How do I iterate an array in an array?
Some on the objects in my array have a nested array. I'm having trouble getting the values these arrays. This is an example from the array: { "item": [ { "title": "Sat, 01 Dec", "pubDate": "Sat, 01 Dec 2018 00:00:00 GMT", "episodes": { "episode": { "show": "The Gadget Show", "name": "Episode 9", "format": "s28e09", "summary": "" } } }, { "title": "Wed, 28 Nov", "description": "" "pubDate": "Wed, 28 Nov 2018 00:00:00 GMT",
How to remove this element? contains() not working
Lets start with a sample page: https://www.ghacks.net/2018/11/26/can-you-use-the-tor-browser-without-tor-connection/ As you can see pretty much at the end there is a line starting "Now you" in bold face. I want to remove the wrapping <p> element (on this and all similar ghacks webpages) after loading of webpage. I tried so far: $("strong:contains('Now Vou')").parent().remove(); $("p:contains('Now Vou')").remove(); $("strong:contains('Now Vou')").parent().css("display", "none"); $("p:contains('Now
Jquery get lowest value in loop object
Hi I am looking a way to get the lowest value in my varients object. so my object looks like this: console.log(this.variants); I can then create one object from the above: var result = {}; $.each(this.variants, function (i, val) { result += val.breaks.split('\n') ; }); console.log(result); which gives me: 25:0.20,249:0.20,250:0.16,499:0.16,500:0.12,1000:0.12,25:0.21,249:0.21,250:0.17,499:0.17,500:0.14,1000:0.14,25:0.29,249:0.29,250:0.24,499:0.24,500:0.18,1000:0.18,25:0.31,249:0.31,250:0.25,499:0.25,500:0.20,1000:0.20,25:0.34,249:0.34,250:0.28,499:0.28,500:0.21,1000:0.21,25:0.51,249:0.51,250:0.41,499:0.41,500:0.31,1000:0.31,20:0.92,259:0.92,260:0.74,519:0.74,520:0.56,1000:0.56,25:0.39,249:0.39,250:0.32,499:0.32,500:0.25,1000:0.25,25:0.52,249:0.52,250:0.42,499:0.42,500:0.32,1000:0.32,25:0.72,249:0.72,250:0.58,499:0.58,500:0.47,1000:0.47,
Add reset / clear canvas link to imahe upload preview
I want to add a reset link to tis script that shows a thubnail preview of image upload, can ayone help please?: function previewImage(el,widths,limit){ var files = el.files; var wrap = el.parentNode; var output = wrap.getElementsByClassName('imagePreview')[0]; var allowedTypes = ['JPG','JPEG','GIF','PNG','SVG','WEBP']; output.innerHTML='Loading...'; var file = files[0]; var imageType = /image.*/; // detect device var device = detectDevice(); if (!device.android){
The dreaded "undefined"
Hello, I have built another to-do list using jQuery. It works exactly the way I want it to. However, there is a pesky little "undefined" word showing up in my output that is wrecking the app just by it's mere appearance. I have tried everything I know but can't seem to remove it. Will someone out there take a look and tell me what they think the culprit is and how to fix it? This didn't start happening until I added the remove code and fadeOut feature near the end of the JS and jQuery code.
Uncaught TypeError: $(...).modal is not a function
Hello Everyone, I am using jquery in react and i am facing this issue. My code is showFileUploadModal(roleType){ console.log(roleType); $('#fileUploadModal').modal('show'); } showFileUploadModal get triggers by a button. I put $ in watcher and i did not find any modal function there, what should i do? I am using jquery v3.2.1 how can i overcome this error?
setInterval with a function PARAMETER of global variable not working
https://jsfiddle.net/jsfiddle135/xpvt214o/956977/ Symptom: setInterval works fine with a global variable WITHOUT ANY parameter. But with a function parameter, the global variable is not passed as a function parameter. ------------------------- $(document).ready(function(){ var str; str=""; var num; function display(num){ // NOT WORKING function display(){ // Fine num++; str=str+num $("#textid").text(str); } setInterval(display, 1000, num); //
How to delete all text following an element?
Assume the following simplified code: <div class="aaa" ....> .... </div> sometext .... How can I delete all text following the element(s) with the class "aaa"? When I write $(".aaa"):nextAll().remove(); then the text is NOT referenced/removed since nextAll() resp remove() address only elements but not simple text. How else does this work? Peter
listen to Click event on dynamically added elements
I dynamically add some elements to an existing element, but I can't get the Click event to work on the dynamically added elements. I've worked with similarly scenarios before and using ON has always worked, but not now. Function: function SetStars(count) { console.log("SetStars (" + count + ")"); var $stars = $createWrap.find(".score-wrap > .stars"); $stars.empty(); for (let i = 1; i <= 5; i++) { let $elm = document.createElement("i"); $($elm).addClass("fa-star").addClass("star").addClass("clickable");
During an $.ajax call some data is lost
Hello, I have a form with a multiple select box. When I select more than one option and send the form via an ajax cal to a php file, only the last option will be saved. Why is that so? This is the AJAX call: var daten = $('#formulargesamt').serialize(); console.log(daten); $.ajax({ url: "/ajax/neukundenanlage/get_formular.php", data: daten, method: "POST", }); n the console.log prompt all data is there (as a string). However in the PHP file it is an array with only the last selected option. Does
jQuery Ajax Abort On Timeout - Strange Behaviour
Hi, I have been battling with a strange problem with the latest version of jQuery. When I run a $.ajax, and give a timeout, I can see the timeout value works in that chrome / firefox shows the xhr request as being cancelled after the timeout period. The problem I have is, subsequent ajax calls to the same domain, from that browser all get stuck in Pending state after the first one timed out. Running them in a seperate browser is fine. They only stick in pending in the original browser until I either
Differences in similar remove() calls
What's the difference in the following two lines? $c.find("script").remove(); and $c.remove("script"); ...where $c is a jQuery object representing a large div (there is a difference in behaviour)
How to select/assign values to element in modal from calling page
In the index page, I have a div that serves as the modal container: <div class="modal" id="edit-document"> <div id="edit-document-container"></div> </div> On this page, I have a drop area that will accept files: <div id="fileUploadDropZone"> <input type="file" name="formlessUpload" id="formlessUpload" class="inputfile" multiple /> <p id="fds">Click/Drop Files Here</p> </div> And some CSS to make the area a drop area: #fileUploadDropZone { width: 100%; height:
I cannot get my questionaire to execute a function when the wrong answer is chose.
When you click on the wrong answer and then hit next, the function does nothing, as it is supposed to either go to the next question or generate a wrong answer modal. Can someone please help and tell me where my code is wrong. $(document).ready(function() { $(".begin").click(function() { $("#main").hide(); return quiz(); }); function startOver() { location.reload(true); } function quiz() { var score = []; var questions = [{ q: "How many years did the original Twilight
Next Page