This code snippet do nothing in IE and crash on Edge, while it's supposed to be supported
Hello, I have what seems like a compatibility problem between this little JS code: https://jsfiddle.net/b9rgachd/ and Internet Explorer and Edge. I have in my HTML a personalized Select (rendered via TWIG in response to PHP, so a bit hard to put in the fiddle): instead of a plain list, each option of the select is displayed inside a div on its own. The div is larger than the label, and, by default with only HTML/CSS, the only way to select an element from those options is clicking on the label,
How to post data / login to a web site via XMLHTTPRequest
Hi everybody, I need some help. I'd like login to www.mywebsite.com/login.html and keep the cookies in order to be used when I will submit the Travel Form as you need to login first before to submit the travel form. Nothing is happening when I try to click on "Login" button. Below is my code and the screenshot of the form. <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){
How to get dynamically added elements in jquery
Hi, I've a requirement to add product items dynamically. We've the jquery functions to do so. But on submit I need to fetch these dynamically added row data and submit to server. Im unable to read the inner elements nested within divs :(. can someone guide with some example. I tried to class name to fetch the element(dropdown in my case) but after getting the data Im not able to pull the selected dropdown value. Here is my code $(".tripDataRow").each(function (index, item) {
Custom Build jQuery Namespace (NOT $ or _$)
We would like to consume jQuery as a library but need to define the namespace specific to our application and allowing consumers of our application to not be depended on our code as well as not wanting to require the developers to add jQuery noConflict. ~ this is a design requirement ~ How would we go about recompile jQuery to have the global variable to be something other then $ or _$; more like pvt$ that only we have use. We don't want to add any new logic to jQuery but should be able to later
Why I am getting no data through JQuery?
Hi, I am using below code to get list of birthdays. I have one birthday in my database on 23/9 and I am able to see it when I check the URL: https://www.softnames.com/the_blessed_tree/ws/populate_birthday_GET.php?day=23&month=9 but getting nothing when I check this URL: https://www.softnames.com/the_blessed_tree/ws/populate_birthday.php?day=23&month=9 The only difference between both is (populate_birthday_GET): $day = $_GET["day"]; $month = $_GET["month"]; and (populate_birthday): $day = $_POST["day"];
Comparison sometimes works and sometimes not
Hi! Can anybody tell mee how the comparison in the script below can sometimes work and sometimes not? It just told me that 355 > 250, but also that 37 > 3587. How can that be possible? <script> $(document).ready(function() { $("form#form-voorraadlijst input[type='number']").focusout(function() { if ($(this).attr('value') > $(this).attr('max')) { alert ($(this).attr('value') + ">" + $(this).attr('max')); } }); }); </script> Hope to hear quickly from you guys. Thanks
Write a date in a datatable search field
Hi at all ,sorry for english , i have a datatable ,with your's search field input , i add an id to this field(id="ricerca_data")in the jquery.datatables.min.js and if i see in console i see this id . I insert a new field to search data by datepicker : <label>Ricerca per data</label> <br> <input type="text" name="" id='select_data' value=""> <br> <br> <input type="button" class='btn btn-warning' name="name" id='ricerca_button' value="Ricerca"> And
i need help.. how to get this work on media?
i'm not good at it and i realy need help on it. As i got thumbWidth:300 how can i get it smaller on media? ;(function($) { "use strict"; $.fn.extend({ youtubeVideoGallery:function(options) { var version = '1.3.0', isLegacyIE = (/\bMSIE [4|5|6|7]/.test(navigator.userAgent)), defaults = { assetFolder : '', fancybox : { arrows : false, closeBtn : true,
Not Able to Add New HTML to Dynamically Created Popover (Bootstrap 3)
Using bootstrap 3 I am trying to add a new HTML element into a dynamic popover like $(document).on('click', '#send-app', function(){ console.log("Clicked!"); $("#result").html('<p>New HTML Element</p>'); }); but it is not working! Can you please let me know how to fix this? Thanks $("[data-toggle=popover]").popover({ html: true, content: function() { return $('#popover-content').html(); } }); $(document).on('click', '#send-app', function(){ console.log("Clicked!"); $("#result").html('<p>New HTML
scroll/jump to anchor on another page query
Is it posible to scroll/jump to an anchor tag on another page and add some padding so the achor is not against the top of the screen leaving some space between the top of the screen and whatever is after the anchor tag? the -- line is the top of the browser's window and normally when you use page.html#title you get somehting like ------------------------------------------------------------------------------------------------ TITLE Donec porttitor libero convallis, dapibus lacus ac, viverra urna.
nextAll() BUT including simple text as well?
Assume the following source structure: <div> aaa <br> bbb <b>mytitle1234</b> ccc <br> <h3> h3headline</h3> ddd <br> eee <br> </div> lineoutside Now I want (simplified) to change the font size of all text which follows "<b>mytitle1234</b>" but only on the same hierarchy level. If I code $("b:contains('mytitle1234')").nextAll()...... then the fontsize of only the <h3> element will be changed. But I want to change "ccc" "ddd" "eee" as well (but not "lineoutside"). How can I achieve this? Peter
Jquery to count words, img,videos and get duration?
Im doing a task that I need to go to a url with an article on it. Count words,img and videos in the main article only. PLUS get video duration. The article page is different every time so I need to first guess which tags are it. I was thinking the logic would be. Find content between each tag. Whichever innerhtml has the most characters in it thats the main article. So count words,img,and videos between those 2 tags. get video duration-i dunno. Is all this even possible? <p>ABC</p> <p>ABCDEF</p>
replace string characters using an array
Hi team, How do I replace invalid characters from a number of strings using an array to store the invalid characters? I know that I have to use the .each function for every string i have eg. $("h2#mytring").each function (){ var thisString = $(this).text(); .................... Now what???? } Thanks in advance Dimitris
Function return true or false
HI sorry for english , i have a function with an ajax call ,this is my function : function controlla_valore(){ var valore= form_clienti.valore.value; $.ajax({ type: "POST", url: "../../common/ricerca_valore.php", data: "valore=" + valore , dataType: "html", success: function(ret) { if(ret==1){ return true; console.log(ret); } else{ return false; console.log(ret); } },
Strange slider jquery animation behaviour
Hi, I'm building a slider. Almost everything is finished -- but there's one issue, when a slide animates across the screen it does so normally until the halfway point and then after that it travels the remaining half incredibly quickly. Also at this halfway point the animation completion callback runs. This is the fiddle of my code: https://jsfiddle.net/90j6mod3/ This is a fiddle of how the slider should animate: https://jsfiddle.net/87bh59p4/ I've tried alternate ways of calling the animate function,
Ajax post doesn't work
Hi, i try to make an ajax type post. I want a form search and enter a food searching in bdd and return the results correspond about the food enter. <form action="" id="searchForm"> <input type="text" placeholder="Search..." name="s" id="food"> <input type="submit" value="Search"> </form> <!-- the result of the search will be rendered inside this div --> <div id="result"> </div> my script jquery : <script> $('#searchForm').submit(function(event) { // Stop la propagation par défaut
Use Mobile Built-in Share Options
Hi, Using JQuery, is it possible to invoke the attached share box for an image to allow use to share the image by whatsapp, email, instagram ,etc...? Thanks, Jassim
jQuery ajax() gets net::ERR_CONNECTION_TIMED_OUT on Chrome, not Firefox or Safari
I'm using Chrome 58.0.3029.68 beta (64-bit) on OSX 10.12.4, with jQuery 3.2.1. I want to use an ajax call to an IP address/DNS name to see if the host is (still) responding. I set up the ajax() call as below. Most of the time, a non-existent device/address returns the expected 'timeout' as the textStatus. (Note: Hosts that do respond will generally return 'error', because this looks like a CORS violation.) $.ajax({ url: "http://127.0.0.20", crossDomain: false, timeout: 6000, cache: false,
Selected Item in dropdown showing All instead of SelectedIndex Changed
I have one dropdown which is optional and need to show only up when there is data and is selected. When is selected, the next dropdown should only show data related to the selected item. For some reason I can see the selected ID but my Jquery function is not returning the matching item, rather returning everything because of the "data: { contractid: window.contractID }". I want to add extra parameter so that if that parameter is present, the related item should be only loaded. Below is my html
Upgrade jquery from 1.11.3 to 3.0
Hello, I am currently using jQuery version 1.11.3, I tried using jQuery latest version 3.0 with jQuery migrate plugin 3.0, but still my code is not working, where can I find the list of functions which are replaced in latest version. I appreciate if I can get help asap. Thanks
Pasting lines into numerous input boxes.
Im using pyperclip in python to send contents of txt file to my clipboard. theres five lines of text. I then go to my browser and I want to take those five lines and paste into 5 input boxes using JQuery. 1st line to 1st input box, 2nd line to 2nd...etc with a bind 'paste'. I looked at jakecigar 's code for doing this but it assumes inputs are stacked beside one another and it doesnt work on my input boxes. (Jakes code) Also I think these inputs are 'hidden', but I can target them in console. A
Changing iframe src with jquery with link not with button
Right now I have the following code which I can change the iframe src using a button <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <input type="button" id="changeframe" value="Change"> <iframe id="declinedframe" class="embed-responsive-item" src="http://forgezilla.com" height="585" width="100%" ></iframe> // Go Last since changeframe hasn't exist yet. <script> $('#changeframe').click(function () { $('#declinedframe').attr('src', 'http://stackoverflow.com');
JSON parse unexpected character
I see plenty of people run into this but their situations seem different. What is the problem in my case? err: JSON.parse: unexpected character at line 1 column 2 of the JSON data If jsonlint.com says it is ok, why does jQuery feel otherwise? $(document).ready(function() {
try {
//alert('Here we go....');
window.jsondata = [{"label_no":"205","label_name":"20th Century Fox Records"}];
// https://jsonlint.com/ says Valid JSON
alert('window.jsondata length = ' + window.jsondata.length);
how can i use wildcard selector on my jquery code
I have jquery : <script> $('div:not(#post-body-xxxxxxxxx)').hide(); // hide everything except id="post-body-xxxxxxxxxx" $('#post-body-xxxxxxxxxx').appendTo('body'); // move id="post-body-xxxxxxxxx" up to the body </script> I want use wildcard selector on xxxxxxxxxx . How can it works with jquery..
hidemodal if a response variable is 1
HI at all , sorry for english. I have a modal to insert data in a db , the workflow is correct and data are saved in db . this is the jquery code : $(document).ready(function () { $("#insert_cliente").click(function(){ $('#ClientiModal').modal('show'); }); $("#button_insert_client").click(function(){ var name_modal = $("#id_class_nome_modal").val(); var surname_modal = $("#id_class_cognome_modal").val(); var telephone_modal
50/50 div min-height to match parent div
Hi, i have two div's which are both 50% of the browser window, the left div contains a paragraph of text and the other div contains an image with background-size:cover. when i resize the browser the div with the text in gets taller and taller the smaller the window gets. I have managed to match the height of the image div with the content div but how do i update the min-height value so it adjusts responsively? This is what i have so far. $(document).ready(function() { var divHeight = $('.AboutLeftBox').height();
Using contains() and not contains() in the same line.
Im trying to run contains() method twice. Also using next() method. I dont know the proper way to do that. I have elements I want to target but they only have b tags around them. Like 'Price:', beside that could be '$2'. If does NOT have '$2' then hide() those elements. (so only $2 prices are shown.) --Find b tags that are next to the b tag with "price"(which would hold the actual dollar amount) --WORKS $('b:contains("price")').next(); --Hides all of them - WORKS $('b:contains("price")').next().hide();
Why is if ($(this) == clickedObject) not working?
i wrote $(document).ready(function () { var clickedObject; $('.knob').mousedown(function () { clickedObject = $(this); }); $(".knob").mousemove(function (event) { if ($(this) == clickedObject) { console.log("test"); } } }); It doesn't work, it doesn't recognise the two objects as being the same. When I log both $(this) object and the clickedObject to the console, they look pretty much exactly the same to me. Am i missing something
Ajax - form select onchange and window load
I have a bit of code for an ecommerce website were developing at the moment when a user lands on the product details page they have the option to select a clothing size. Once the size is selected it shows the price and whether it is in stock. This is triggered by an onchange event on the select menu. When the page loads the first size auto selected but doesn't display the contents i.e price and stock level. is there anyway i can simply show this information when the pages loads? any help greatly
innerhtml/html text is not working in chrome
Hi, I am want to implement <br> in listbox item text but it's not working in chrome but working in firefox. need to know any alternate way to resolve this issue. HTML: <select id='lstBox1' style="width:240px;height:346px" multiple="multiple" > <option value="1" >ABCDEFGHIJKLMNOPQRSTUVWXYZ</option> </select> Jquery: $("#lstBox1 option[value='1']").innerHtml("ABCDEFGHIJKLMNOPQ<br/>RSTUVWXYZ"); Note: So that it will display in listbox like: ABCDEFGHIJKLMNOPQ RSTUVWXYZ
a.stopPropagation is not a function
In jQuery 2.2.3 , I got issue while using event.stopPropagation or return false. 1)When using event.stopPropagation i got error - a.stopPropagation is not a function 2)When using return false i got error - a.preventDefault is not a function
Post and Retrieve the same time using ajx
Hi, I am using below code to post signup data using ajax but at the same time to get the registered data using json so it can be used by the browser. $.ajax({ type: "POST", url: 'https://www.mydomain.com/ws/signup.php', data: formData, processData: false, contentType: false, }).done(function () { viewModel.loadPanelVisible(false); customer.insert({ customer_id: data.Customer[0].customer_id, first_name: data.Customer[0].first_name, last_name: data.Customer[0].last_name,
Use “Esc” key to accomplish two tasks at once
On THIS page, I have a div with the class of “video-wrapper” witch, upon clicking the player’s toggle full screen button, is dynamically added a “full-screen” class. I aim to remove the “full-screen” class not only by using the toggle full screen button, but by pressing the “Esc” on the keyboard. foe this purpose I have written the code: $(document).on('keyup',function(evt) {
if (evt.keyCode == 27 && $('.video-wrapper').hasClass('full-screen')) {
console.log(evt.keyCode);
$('.video-wrapper').removeClass("full-screen");
query inserting dynamic html as string instead of html?
I have the following code which inserts a div at the top of a page: function setUpAnnouncementsContainer() { var announcements = 'Letterpress scenester franzen, shabby chic meh hella knausgaard 3 wolf moon craft beer ethical chillwave hot chicken beard. Tbh vexillologist tousled .'; var divAnnouncements = '<div id="divAnnouncements">' + announcements + '</div>'; var divAnnouncementsContainer = '<div id="divAnnouncementsContainer" class="col-xs-12 col-md-12 col-xl-12">' + divAnnouncements + '</div>';
date picker not showing calendar image
Here is my code: $( "#datepicker" ).datepicker({ showOn: "button", buttonImage: "images/calendar.gif", buttonImageOnly: true, buttonText: "Select date" }); In the working directory, there is an images folder, then a file called this. Why isn't this image showing up?
How to output step by step all found elements and results of functions?
Assume I have a jQuery command like: $('div[myattr="foobar"]').parent().remove(); How can I wrap (?) this command so that: - all found core elements are listed (at the console)? - all found parent() elements are listed (at the console)? - the result after remove() is shown at the console ()? Peter
SharePoint 2013- How to check using jquery/JavaScript, any option of radio button is selected or not without using ID or name?
Hi , Below is html Code.How to check using jquery/JavaScript, any option of radio button is selected or not without using ID or name as control id and name will change in production(pl also refer attached image) and please consider there are two radio button in page with same value Yes,No but with different Label like for below one it's "Will you site contain ZNA records" and for second one is "Do you want team site" <tr> <td width="190px" valign="top" class="ms-formlabel"><h3 class="ms-standardheader"><nobr>Will
Jquery fortune wheel getting wrong result
I am creating a fortune wheel using jquery and want to getting the exact number from the spinning wheel Jquery I am using this in html $( document ).ready(function() { var prices = [ { name: '0' }, { name: '1' }, { name: '2' }, { name: '3' }, { name: '4' }, { name: '5' }, { name: '6' }, { name: '7' },
Unable to create checkbox
I'm trying to create checkboxes dynamically, but it's not working. I'm using following code ( function( $ ) { $(document).ready(function() { $('#services').on("change", function() { $('#doclist').empty(); currentCat = $(this).val(); data = $.parseJSON(bookingdata); $.each(data[currentCat], function (index, value) { $('<input />', { type: 'checkbox', id: value.id, value: value.name }).appendTo("#doclist");
Show only related Items in dropdownList
I have two dropdownlist and want to show only related items. When the first dropdown item is selected show the item in the second dropdown based on their ID's. Don't show everything. Below is my Jquery <script type="text/javascript"> $('#ddltest').change(function () { var contId = $("#ddltest").val(); var _tt = $(this).val(); $.ajax({ type: "GET", dataType: "json", url: "/Upload/Load", data: { id: contId }, success:
Next Page