Trying to use jquery.post
I have a chrome extension that uses appendGrid which uses jquery. For that reason I already have jquery included in my popup html. It is an older version of jquery but it works so I don't want to break it. I have been having issues with using XMLhttp to do CORs so I want to try using jquery's $.post. But I am getting $ is not defined. Now realize that you can't mix html and js in a single module in an extension. And the includes for the jquery (can't be from a CDN). The include for the background.js
Enable button after all radio button lists have a selection
Hello, I'm new to jquery and I'm not sure how to approach this issue i'm having. I have a web page that has 2 radio button lists on the main page and 4 more radio button lists on a modal popup when a user checks a checkbox the popup appears. On the initial page loads the save button on the popup needs to be disabled. I need to use jquery to enable the save button only when all 4 radio button lists have a selection. If the clear button on the popup is clicked the radio button lists on the popup
Jquery How to send HTTP request after form control ?
Hello How to send a HTTP request with Ajax after checking if the inputs ".name_column" and ".taille" are not empty. Both inputs are create dinamycally with the append function. Than you in adavance. Joce. $(".btn_validate").click(function () { //alert('btn_validate'); //--------------------------- //FORM CONTROL //--------------------------- $('.name_column').each(function(){ $(this).change(function(){ $(this).css({"border" : "", "background-color" : ""}); }); if( !$(this).val() ){ $(this).css({"border"
I'm creating a monster
I am an amateur jQuery user and I'm replicating a spreadsheet from excel into jQuery drop down choices. At this point I've got 3300 lines of code and 214,000 characters. I'm just looking for feedback from others to see is this normal? Most of my code is for placing data into arrays and then I seem to be repeating a lot of commands when I show the data in my drop down list.
Get Target of on click
I have a subclass element (.myclass) that is added after the DOM is initially loaded and there may be several on the page. I have an on-click to detect the clicking of the class like this: <div id="wrapper"> <span class="myclass">Click Here</span> </div> The jQuery: $('#wrapper').on('click', '.myclass', function() { console.log('Inside'); var target = $(this).find('#wrapper .myclass'); console.log('TargetThis: ' , target); }); How do you target the class element that was just clicked. Currently
How to access global variable inside jquery mouseout event?
// access variable ttt inside the function var ttt="123"; $("#records_table tbody").bind('mouseout',{param : ttt}, highlighselecteddates); function highlighselecteddates(event){ var data = event.data.param; // throws ref error console.log(data);/ throws ref error console.log(event.data.param); // this logs properly. }
Get data attribute value of targeted element.
I am using a Jquery extension which is used like this $('.target_input_box').datetimepicker({ //properties declared here }) .target_input_box elements have a range of data attributes which need to be used in the datetimepicker properties something like this <input class="target_input_box" data_mindate="01/01/2000"> <input class="target_input_box" data_mindate="01/01/2010"> $('.target_input_box').datetimepicker({ mindate : // data_mindate of current .target_input_box }) How can i get this?
Migration From jquery-1.11.1.js To jquery-1.12.4.js
Please Can You guide me Migration From jquery-1.11.1.js To jquery-1.12.4.js And Whats are the related Changes,ajax method is comparable in jquery-1.12.4.js
Prevent onclick being attached to all items.
Hey all. I am having this problem. I have added a button to a select2 input field. The problem seems to be that the click event is being bound to each item in the a.$results. I want the click to be only on the button. I have a jsFiddle set up with the problem https://jsfiddle.net/sm1fo5d0/10/ Thanks in advance. let a = $(this).data('select2'); if (!$('.select2-link').length) { a.$results.parents('.select2-results') .append('<div class="select2-link select2-close"><a>Close</a></div>')
Form submit tracking
I have this for link click tracking... $(document).ready(function() { $('a').click(function (event) { var id = $(this).attr("id");What would be the equivalent for track form submissions? We use jQuery Validate and would trigger the form click tracking function with the submitHandler. submitHandler: function(form) { formClickTracking(); } ;
Youtube Api multiple videos not firing events
I have a page with 10 buttons linked to Youtube videos using the Youtube api. When the page loads I don't want any videos to be shown until one of the buttons is clicked. This bit is working well. I am trying to get the video to play when the button is clicked and remove the video when it ends (this is the bit I'm having trouble with). The video ids will be variables from a json response. I have hard coded them here just for testing. This is the code I'm using just to test: <html> <head> <script
filter a list by the class name
I want to filter a list by the class name in searchDIV . The $("#searchDIV *").filter works for searching everything but I want just the class name or really the name of <?php echo $partno ?> Thanks for the help! Travis <input id="searchInput" type="text" placeholder="Search.."> <script> $(document).ready(function () { $("#searchInput").on("keyup", function () { var value = $(this).val().toLowerCase();
trying to work out why this code doesn't work
When I debug it, I get something on the click even and get the correct ID for the clicked element, however, the LINK doesn't change to Unblock and the CSS doesn't change $(document).on('click', '.block-news-row', function () { var ID = $(this).attr("ID"); $.ajax({url: "block-news.php?ID=" + ID, success: function(result){ $(this).html('Unblock'); $(this).toggleClass('block-news-row', 'unblock-news-row'); }}); });
Get this value from span
So now I have multiple prices and when I click button I only get first price in the list. This line always return first price in the list no matter which price I click. var itemPrice = $(this).closest("div.row").find("#price").text(); <div class="row"> {{#each items}} <div class="col-md-3"> <ul style="list-style: none;"> <li class="text-center"> <div class="popup" onclick="itemPopup('myPopup{{this._id}}')"> <img class="item" id="itemImg" src="{{this.img}}"><br> <span class="popuptext" id="myPopup{{this._id}}">
Need to append image to to div.
Okay so on click function I do this: var item_img = $('#itemImg').attr("src"); I get the src of the image. And then the problem is that I have more than one item but each item have the same class. So whether I click on second image or on third I still append first item image. I need to get somehow unique image when I click button. This is the code: <ul style="list-style: none;"> <li class="text-center"> <div class="popup"> <img class="item" id="itemImg" src="{{this.img}}"><br> <span class="popuptext"
How to handle jquery Ajax response if it binary large object data type.
hello all I am using $.ajax with GET method to fetch data from server. The data is some file and i am getting binary data. In xmlHTTPRequest, I am able to set responseType to blob, but while doing same in $.ajax, the error event executes even after response is 200 and readyState is 4. this is what i used. $.ajax({ type: "GET", url: fileUrl, success: function(data, jqXHR, response){ var blob = data; console.log(blob); console.log(jqXHR); console.log(response); console.log(((new Date().getTime())-startTime)/1000);
How to set/unset active links
I have a set of links (same URL). I'd like to make the following changes to the "li" element when its associate link is clicked: 1) Add a class='active' to li element. 2) Remove the "a" anchor, and keep only the "span" element. **HTML before jQuery:** <ul class="navbar-list"> <li><a href='#' data-id="1" > <span>Link 1</span></a> </li> <li><a href='#' data-id="2" > <span>Link 2</span></a> </li> <li><a href='#' data-id="3" > <span>Link 3</span></a> </li> </ul> Using
AJAX to Classic ASP
Hi All, I would like to ask, How to use serializeArray from jquery going to classic asp, I am using AJAX. what would be the syntax to be in AJAX,, and what would be also use in classic asp? please help. Thanks
close modal by clicking outside modal
Need help, can not get it working..! Would like to close div by clickin outside this div. Example: https://next.plnkr.co/edit/eOYp60O8UvRgK6Bc?preview
get the position (y corodrinate) of anchor tag passeed in URL
Hi, I am trying to determine the position of the anchor tag in the URL. I tried var element= $('#gallery').find(hash); var loc = element.position(); alert("Pos = "+ loc.top); where #gallery is the id of the div contacting the gallery hash is anchor id passed in in the url When using Firefox's "Inspect Element" and in the console tab I'm getting TypeError: loc is undefined
popover event changing
Hi everybody, currently trying to figure out which event listener has “login” element. Please look here: loadbee.com -> navigation login. <a> has popover method, Login window appear/dissapear with onmouserover/hover(not sure) event, i would like to change this event to Click event, clicktoggle to be exact. Thanks in advance
animate executing immediately (jQuery v3.3.1)
Hi, I’m writing a site using jQuery 3.3.1. All the animations that I include are running immediately. For instance: $('#l_B').css({left: '10px'}); $('#l_B').animate({ left: 200 }, { duration: 2000, step: function ( now, fx ) { console.log('1 >> ' + fx.elem.id + " " + fx.prop + ": " + now); } }); The element l_B move immediately, in just one step. Going through the animate source (file effects,js), I
Menu with tabs with jQuery
Hi, I want to navigate the tabs: But when I click on "Description" or "Content" it goes like this and does not come back: How do I get this? Part of the code in php: <script type="text/javascript" src="js/jquery-1.6.4.min.js"></script> <script type="text/javascript" src="js/abas.js"></script> Another part of the code in php: <section id="abas-geral"> <ul class="menu"> <li><a href="aba01">Description</a></li> <li><a href="aba02">Content</a></li> </ul> <section id="box"> <div id="aba01" class="conteudo">
Passing URL parameters through hidden fields
How can I grab a couple of URL parameters and pass them through hidden fields in a form submission? The strings are structured like this: https://alert17.com?sid=TESTSID&wid=TESTWID
How to calculate days interval from a today?
I have these two inputs in the first of which, i have a dropdown with the days and on the other one i have a datepicker formated date. What i want is if i select a value from dropdown to show the date in the datepicker input, and the same backwards. That's my snippet so far, but in the input i get a full fomated date something like, "Wed Apr 03 2019 00:00:00 GMT+0300 (Eastern European Summer Time)".. https://codepen.io/HarrysR/pen/LJaegm Any help on that? For any further clarification feel free
toggle show and hide - shows but doesn't hide
here is my html <div id="space_manager_saved_search_selection"> <div class="saved_filter_tile firstfour" data-filter-id="5"> <h5>john</h5> </div> <div class="saved_filter_tile firstfour" data-filter-id="9"> <h5>christine</h5> </div> <div class="saved_filter_tile firstfour" data-filter-id="10"> <h5>christine1</h5> </div> <div class="saved_filter_tile firstfour" data-filter-id="12"> <h5>johndc</h5> </div> <div class="saved_filter_tile afterfour" data-filter-id="13"> <h5>here
ajax content into dynamic loaded div
My more-news-holder is loaded dynamically, i think this is why when this code runs. my result does not go onto my page. how can i fix this? <div id="more-news-holder"></div> <div class="more-news-container"> <div id="more-news-btn" class="more-news" hreh="#">Get More News</div> </div> Here is my jquery $("#more-news-btn").click(function(){ $.ajax({url: "content/more-news.php?C=" + NewsCount, success: function(result){ $("#more-news-holder").html(result); NewsCount = NewsCount + 30; }});
Pushing a nested div underneath its ancestor for mobile
Is there a jQuery way to move a nested div underneath its great grandparent for mobile view. Here's what I've started: https://codepen.io/Codewalker/pen/aaPRrz One thought is to create this twice, hiding one and showing the other, depending on the device/width. <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" type="text/css" rel="stylesheet"> <div class="container" style="background:#ddd"> <div class="num-container"> <div class="num-thumb"> <img
add class onto an element
Hi, I would like to add a class onto my element saved_filter_tile Although when I try to, it adds the class onto the h5 $("#space_manager_saved_search_selection .saved_filter_tile h5").off().on("click", function(){ console.log("I am here!"); $(this).addClass('selected'); });
Issue with upgrading jQuery
I am working on upgrading jQuery in my application from version 1.11.2 to 3.3.1 Even when .live() function is removed after 1.9, I am seeing it being used in multiple places in my application and it is working also with version 1.11.2 Now, when I am upgrading it to 3.3.1, the behavior that I have seen is that .live() works in some pages while it gives error in some other pages and needs to be replaced with .on() So, my question is: "Do I need to change every occurrence of .live to .on when I am
can't get .indexOf to return expected value
This question was asked, and I would like to include additional info for the solution. Original post: I'm trying to select all elements that has a class that starts with "col-md", but no matter what I do .indexOf("col-md") returns -1. Html: <div class="col-md-4"> Test 1 </div> <div class="col-md-8"> Test 2 </div> jQuery: if ($col.attr("class").indexOf("col-" + val.toLowerCase()) > -1) { console.log($col); } val is "MD" Original post ends here ----------------------------------------------------------------------------------
Javascript to jQuery help?
window.onscroll = function() { progress() }; function progress() { var winScroll = document.body.scrollTop || document.documentElement.scrollTop; var height = document.documentElement.scrollHeight - document.documentElement.clientHeight; var scrolled = (winScroll / height) * 100; document.getElementById("myBar").style.width = scrolled + "%"; } I thought something like this might work : jQuery(document).ready(function($) { $(document).on( 'scroll', function() { if ( $(document).scrollTop()
How can I add elements to tag
Hi, I'm trying to generate a 'a' tag with some parameters to call a function which makes a rest call, divHTMLPages = "<a href='#' onclick='getRestResults(" + $('#queryU').val() + "', '" + _reg + "', " + _rowLimit + ", " + previousPageCount + ")'>" + i + "</a> "; $('#pageU').html(divHTMLPages); But the result is not well-formed I see double quotes after getting #queryU.val() and that's not correct, what would be the correct form for doing this? I have read about jQuery .add but not sure this
Create new tab and rename its title
In my single page application a user can open links in a NEW tab. I would like the tab's title be named based on the particular link they clicked. However, the original tab's title gets renamed. Can someone show me how to rename my "New" tab instead? $("#contextMenu").contextmenu({ delegate: ".hasmenu", menu: [ { title: "Open in new tab" }, ], select: function (event, ui) { var page = ui.target.children('a').context.nameProp; var parent = $(this).closest('div').attr('id');
can't step into for each loop in Firefox Debugger
I'm trying to do an $.each on a json object, but when debugging in Firefox it's just steps over this code, like something goes wrong. Code: var query = { name: "test" }; $.each(query, function (k, v) { if (i === 1) { tmp = "?"; } else { tmp += "&"; } tmp += k + "=" + v; i++; }); Am I using $.each wrong?
jQuery v3.3.1 IE 11.0.45 SyntaxError...
Hello, I searched the forum but no joy. This error appears frequently. Ideas? Thanks, Mark
Set specific href for each tab
Hi. I want to set my href for each tab. Here's my code: <ul class="category-account"> <li class="tablinks" onclick="openTab(event, 'Home')" id="defaultOpen"><a href="#home" class="justify-content-between align-items-center d-flex"><h6><i class="fa fa-cogs" style="width: 20px;"></i>General</h6></a></li> <li class="tablinks" onclick="openTab(event, 'Logsec')"><a href="#logsec" class="justify-content-between align-items-center d-flex"><h6><i class="fa fa-shield" style="width: 20px;"></i>Login Security</h6></a></li>
How to merge selected table cells on button click using j query.
I have created a dynamic table and selecting the table cells using j query. Now i want to merge the selected table cells on button click. How can i do this. Thanks, Regards. function CreateTable() { var rowCtr; var cellCtr; var rowCnt; var cellCnt; var myTableDiv = document.getElementById("myDynamicTable"); var table = document.createElement('Table'); table.border = '1'; table.id = 'myTable';
Select only childs contained inside its parent
Hello, I created this simple jquery -> http://jsfiddle.net/psytanium/6D9kS/401/ I'm very beginner with this language, I'm trying to clear all check boxes when "All options" is checked, and vice versa. I'ts working fine, but it is affecting the other forms too. The problem is I have multiple forms, I need to apply this script to each form separately. Thanks :)
How to merge selected table cells using j query.
I have created a dynamic table based on user input using c#, and written jquery to select the table cells this is working fine. Now i want merge the selected those table cells using j query or java script. how can i do this? C Thanks, Regards. Code Behind: private void CreateTable() { int rowCtr; int cellCtr; int rowCount; int cellCount; Table Table1 = new Table(); Table1.ID = "myTable"; rowCount
Next Page