remove() certain paragraph does not work
Lets start with an example webpage (german online magazin): https://www.heise.de/news/Reaktionen-zur-Great-Firewall-made-in-the-USA-4866141.html?view=print As you can see in the mid column pretty much at the end there is a section with picture and headline "LESEN SIE AUCH". I want to get rid of it all (after loading of webpage). Therefore I applied a script containing the following jQuery instruction: $("a-collapse").remove(); However it does not work. How else can I remove elements with own unique
new elements not be listener
Hi, if the main html page contains: ..... $( ".abc" ).on('click',function() { console.log('a'); }); .... If used Ajax to get multiple buttons with a class 'abc' and added the button to my html page by .html() now the buttons are not listener and if clicked not do the console.log, because it was not available when the page loads,how to solve this? and whats license of contents of this forum? are all codes are under public domain also from the forum? Thanks
what is are the differences between empty() and html(“”) in jquery
I noticed people using $("#div1").empty() to clear every thing inside the div, with attached events . and $("#div1").html("") to achieve the same. pls, tell me the difference between them or which one should be used.
Add Multiple Row In A Table and Sub Row
With jQuery, most of the time we add rows one by one in a table or delete them. But in my case, the requirement is bit different. Say I've a table and have to add new row and tested the below: HTML: <button class="addRow"> Add New Row </button> <table> <thead> <tr> <th>Rows</th> </tr> </thead> <tbody> <tr> <td>Row 0</td> </tr> </tbody> </table> Script: <script> var lineNo = 1; var html = ""; $(document).ready(function () { $(".addRow").click(function () { html = "<tr><td>Row" + lineNo + "</td></tr>";
UI slider isn't visible after page loads into container
- The body of index.php consists of a navigation bar with links and a separate container with the id="pageContent". - In my JavaScript, when the page loads it loads another page (HomePage.php) into #pageContent ($(#pageContent).load('HomePage.php');). - As for the navigation bar; it takes the name of the clicked link as a variable, adds .php to the end of it and loads that into #pageContent: $('#navContent a').on('click', function() { var page = $(this).attr('href'); // Get link name $('#pageContent').load(page
My change event selector is not working anymore after an AJAX call?
Hello, I have an table which initial filled server sided with 300 rows or it can be even more. var strhtml = '<table id="table" class="">'; strhtml += '<tbody>'; strhtml += '<tr>'; strhtml += '<td><input type="checkbox" class="select" id="select_' + result.data[i].cmid + '" name="select_' + result.data[i].cmid + '" value="' + result.data[i].cmid + '"' + checked + '/></td>'; strhtml += '<td><input ... strhtml += '<td><input type="text" class="update" id="shnr_' + result.data[i].cmid + '" name="shnr_'
jQuery playPromise not working in script for audio on hover
As per this tutorial https://developers.google.com/web/updates/2016/03/play-returns-promise I'm trying to implement playPromise in my code. The reason: Google chrome policy changed and now autoplay is not working out of the box anymore. The instructions: A play() call on an a or element now returns a Promise. If playback succeeds, the Promise is fulfilled, and if playback fails, the Promise is rejected along with an error message explaining the failure. This lets you write intuitive code like the
how to send more than one record at a time using javascript to a wcf data service for updation
I have one WCF data service, now I want to use jquery to send set of records to wcf data service for updating at once, any link with an example would be more helpful. thank u
How to save the sequence in the database after dragging dropping
i have this code which is interchanging images location as soon as they are clicked and dragged and place on the other image below is the javascript code and i am using jquery ui for this <script > (function () { var droppableParent; $('ul .element').draggable({ revert: 'invalid', revertDuration: 200, start: function () { droppableParent = $(this).parent(); $(this).addClass('being-dragged');
.ajax reports success status but runs the error method
Maybe I am doing something wrong, but this looks like a bug to me. I run the .ajax method show below: 50 $.ajax( 51 { 52 url:"ajax_setEmail_16.Chg", 53 type: 'POST', 54 dataType: 'json', 55 data: JSON.stringify(jem), 56 contentType: 'application/json', 57 mimeType: 'application/json', 58 success: gotEmailAddr16, 59 error: function(xhr, status, error){ 60
How to use HTML Forms inside <script> tags or in a function()
I have a select options box to choose a query. Select All, Select by State etc. I have one choice which requires further input - Search by Partial Name. Is there a way to do this by having a <form> show up inside a script or function. I would then use $("#partname").on('click'. function() { put form in here and use input.val() to get the value to Return}. Summary: One choice can use AJAX directly to get info from Database. Another choice requires further input before using AJAX
Can't always drag draggable element into empty sortable list that has its height set on start of dragging
I have a draggable element and two sortable elements which are empty (meaning their height is 0). I am using connectWithSortable to drag the draggable element into one of the sortable elements. This only works if the draggable element will fit into the sortable element (i.e it's height allows for it). By giving the sortable elements a height of 100px, it works: https://jsfiddle.net/cekwuyq1/ However, I don't want the sortable elements to have this empty space of 100px. Instead, I want their height
What use instead of the below jQuery Library? Android Play Developers Pre-launch report for APK :
What use instead of the below jQuery Library? Android Play Developers Pre-launch report for APK : The security section identifies issues found after checking your app’s APK file for known vulnerabilities. Vulnerable Libraries Detected in APK 20, 10 Your app contains one or more libraries with known security issues. Please see this Google Help Center article for details. Vulnerable JavaScript libraries: Name Version Known issues Identified files jquery 1.10.2 SNYK-npm:jquery:20110606 SNYK-npm:jquery:20150627
Dynamically populate the options of a select, from AJAX call, and add conditional the selected option?
Hello, I have an AJAX call created by changing the value of select element, and I get the response array with data to populate another select element. This itself is working for me now but I'm not convinced/satisfied how do this. This how I have realize it now: if (result.data[i].fsel) { jQuery('#'+flID) .append(jQuery("<option></option>") .attr("value", result.data[i].tlfc) .attr("selected", "selected") .text(result.data[i].tlfn); } else { jQuery('#'+flID)
How to Enable jQuery Each on Dynamically Added Content
Can you please take a look at this Demo and let me know why I am not able to use the $('.quantity').each(function() when adding the content dynamically to the document? As you can see the $('.quantity').each() is functioning properly when is hard coded but not working on dynamic content $('.quantity').each(function() { });
how to show the div on click of button while the processing in side the button click is going on.
i want to block the web page so that if i click save button, then while the save button is processing one should not be able to click on any other button and after the process of the click of save button is over then form should be available. Q1) how many ways this could be achieved. q2) following is the way i am using but it is not showing the div unless the processing of the loop finishes. <style> #popupblock { width: 100%; height: 100%; position:
Getting textarea value with line breaks
I have a textarea, and i am adding some text in it dynamically(with line breaks) that could look like this: a b c Now when i get the value of this textarea: var strInput = $('#myTextareaID').val(); It returns: 'abc' So without the line breaks. How can i get my text with line breaks or space between them, i need those lines individually. Thanks in advance.
Two factors authentication
Hello everybody, By error, when connecting to the forum, I got the "recognize this computer" checkbox checked, and I find that nowhere in the preferences. Is it possible to come back to 2 factors authentication ? ** Well, that is done, I shall pay more attention. But is there any interface to manage that ?
can i declare define funtions in document.ready and use them at more than few places.
hi, Q1) should i define and declare this function inside the docuent.ready or outside. i do not need this x2() function any where else , i need it inside only. $(document).ready(function () { function x2 () { alert("abc"); } $('#ddlcomp).change(function (event) { x2 (); }); $('#ddlcust').change(function (event) { x2 (); }); });
live search jquery and show to the table
hello, i'm creating live search and show it to the table here the ajax $("#cari").on('keyup', function(){ var cari = $("#cari").val(); $.ajax({ type: "post", url: "do_kasircari.php", data : {cari: cari}, dataType: "text", success: function(data) { $("#hasil").load(data); console.log(cari); console.log(data);
How to prevent a jQuery widget appended to a selectable from growing bigger onmouseover?
Hello dear jQuery UI developers and users! In an HTML game I have created a custom jQuery widget called table representing a rectangle green table with up to 4 players sitting at it: In the above screenshot 4 such tables are appended to a #tables3 selectable by the following code: var tablesList = $('#selectable').selectable(); var table1 = $('<li/>').appendTo(tables3).table({ gid: 3 }); var table2 = $('<li/>').appendTo(tables3).table({ gid: 104, player0: { rep: Math.random(),
how to add css class to check dynamically
Hi, I am trying to add CSS class to a disabled checkbox when clicking a button. Here is the code, but it doesn't work, please help. <style> .input[type="checkbox"]:disabled + label{ outline:5px solid red; background-color:red; } </style> <script> .input[type="checkbox"]:disabled + label{ outline:5px solid red; background-color:red; } </script>
Android APK app background different from chrome developer console background
I am working on a cordova android application. The application uses jquery-mobile-1.4.5.min.js and jquery-mobile-1.4.5.min.css . I have problem with the background color of the application. My application when I open the HTML page directly and view it in mobile viewport of chrome/firefox developer console it looks similar to figure in 1 However, When I generate the apk file(using cordova) and install the apk file in my android device I can see an app as shown in figure 2 So, there is a clear conflict
Show Data With Previous and Next Button Using jQuery
I am working on a project where I've to show data using **Next** and **Previous** button clicked accordingly. My requirement is something like this: (By default, data will be loaded from database and will be rendered as follows) 1 1.1 Clicking on next button, it should render the following and vice-versa: 2 2.1 2.2 I did few researches and got one that worked perfectly but unfortunately it didn't work as expected because it simply works on individual div as below: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
can't download jQ UI -- get 502 error....
can't download jQuery UI..... get this error... 502 Bad Gateway (land on this url, http://download.jqueryui.com/download, and get this 502 error... funny... same thing happened in my own website a few days ago... it took my webhosting about two hours to fix it.....) have tried several times, in two browsers....
Validate works too well
The goal for this project is to validate the email field is NOT including freemail (gmail, yahoo, outlook, etc etc) domain. I am stuck at this point on it though and any assistance would be great. Basically it errors on any domain telling me I need to use a business email address. This should only happen if they input one of the freemail addresses. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/additional-methods.js"></script>
I'm trying to create an XML-file from the values in the input fields, but gets error message
I'm trying to create an XML-file of the values from the input fields: https://jsfiddle.net/8w1rb9d4/1/ But I'm getting the error message: "Failed to execute 'serializeToString' on 'XMLSerializer': parameter 1 is not of type 'Node'.". The error message doesn't show very well in JSFiddle because of the text almost has the same color as the background. So what could be wrong? Is there more to it than what is already in the code? Am I missing something?
Jquery DatePicker Color Day
I have using Jquery Date Picker. I wanted to change the background color for the list of dates. like 21/07/2020, 22/07/2020, 2/08/2020. Kindly let me know if anybody already implemented this scenario.
Ceck, if a tab already exists.
In a callback, I open tabs like this: $('#packageTable tbody').on( 'click', 'button', function () { var data = table.row($(this).parents('tr')).data(); var tabId = "tab-" + data.id; $("<li id=" + tabId + "><a href='" + tabId + "'>" + data.package + "</a</li>") .appendTo("#tabs .ui-tabs-nav"); $("#tabs").tabs("refresh"); }); In other words: The tabs have an associated id. (The tabId.) Now, I'd like to change the callback
Validate the field that has an earlier date
I'm using google translator. I have this script, which I use to validate the fields on a form. /****** Validate ******/ $("#form_garantia").validate({ rules: { nome: "required", telefone: "required", email: {required: true, email: true}, tipo_equipamento: "required", localizacao_equipamento: "required", data_ocorrencia_falha: "required",
Concatenating two input fields into one hidden field and passing on form submit
I got a request to send full-name when a form is submitted. The form gathers first-name and last-name and I just need to concatenate them and submit it in a hidden form field. Here's what I have so far for something that should be simple, but I'm missing something here: <input name="firstName" id="firstName" type="text"> <input name="lastName" id="lastName" type="text"> <input name="fullName" id="fullName" value="" type="hidden"> $("#new-user").submit(function(event){ var fName = firstName.val();
Hide fixed div when scrolling over another div
I am trying to use Jquery to hide a fixed position div .wp-fixed (always shown at the bottom of screen) anytime the user scrolls over another div .wp-over (i.e. when .wp-fixed is within the .outerheight of .wp-over)? Not sure how to approach this. any help would be much appreciated
Selecting correct radio button using jQuery
I have 4 radio buttons and a data table that has a row that matches each radio button value. When I select a data table row the corresponding radio button is selected. I can cycle through all data table rows and watch each corresponding radio button get selected. If I select a data table row that has the same radio button value of a previously selected row or go back and re-select a row, the radio buttons stop being selected. Can someone tell/show me why my radio buttons are not being selected the
Changing CSS in iframe with jQuery
Hello, i want to change the CSS of an iframe (iframe content comes from the same domain but the iframe should be displayed a little differently, which is why I cannot change the CSS on the main page) as easily as possible using jquery? The code should also work if the iframe is lazy loaded. The following code doesn´t work for me (without lazy load and with lazy load): <script>$("iframe").contents().find("#Anker-PowerCore-10000mAh").css("display", "none");</script> #Anker-PowerCore-10000mAh is the
Is there any way to put google sheet data into HTML div?
I want to combine google sheet with my website. My idea is when I update data in my published google sheet, the HTML div tag with a certain id (the content of divID column in my sheet) will automatically fill in the data to it. For example, So, if I create a div with id="K800",the model number, like <div id="K800"></div>, then it will fill in a <p> with the data into the div, just like this: <div id="K800"> <p>Model Number: K800 Product Name: Large Gripper Manufacturer: Niryear</p> </div>
Removing the blue halo on button and input focus.
I have been searching online for a solution to this but am a little stumped. How is it possible to remove the halo effect when a button is pressed or an input field has the focus. Thanks in advance.
when and where i should use const.
hi, Q1) i want to use const of javascript and let with jquery 1.9 on my page , can I use it? Q2) I have more than one js file on my aspx page, what I have noticed is that in each js file , I have some variables which are declared with var but they are nothing but abbreviation(which are not changed). so can I make them const?
How to hide version information of JQuery in generated web response?
I see the version information of JQuery, is being rendered in the web response. Is there a way to hide it? Hackers can easily exploit the app by knowing the problems with specific version.
Dynamic File Upload - Is this possible?
Hi, I am attempting to customize a shopify website that sells custom mugs/cups. A user can customize their mug by choosing various preset options and text input fields. When they have completed the customization there is a button for them to generate a preview of the mug. The problem I am trying to solve is that at the moment the image doesn't get submitted to the cart. So, I have added a file input object to the form. But it currently has the "Upload File" button. Instead of allowing the user to
How to compare two arrays and get index in the form of an array?
Here are two arrays: arrayOne = [a, b, d, g, k] arrayTwo = [a, b, c, d, e, f, g, h, i, j, k] Since these two arrays have some elements in common, I want to get the index of [a, b, d, g, k] in arrayTwo, and then put those index to an array. Is there any way to do it?
Next Page