Download file using ajax GET request
Hi, I'm trying to downloading a file using ajax GET reques, but nothig happens This is the code: $.ajax({ url: "downloadAvviso.php", type: "GET", dataType: 'binary', success: function(result) { var url = URL.createObjectURL(result); var $a = $('<a />', { 'href': url, 'download': arg1, 'text': "click" }).hide().appendTo("body")[0].click(); URL.revokeObjectURL(url); } }); where arg1 is the name of
Getting the textbox value
Hello, I have this code. I want to get the value of textbox, I will set up the "code" that will need to put to textbox and based on the input they will redirect to their respective url. <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <input id="code" name="code" type="text" placeholder="Input company code" /> <button id="btnSub" name="Submit">Submit</button> <script type="text/javascript"> $("button:#btnSub").click(function () { var codeval = $('#code').val(); if (codeval ==
Adding removing input fields using jQuery
My code: https://codepen.io/juscelinobarao/pen/MrxMNz I'm having trouble deleting the new inputs created using jQuery. I do not know what to do for the code below to eliminate the correct div. $ (wrapper) .on ("click", "delete", function (e) { e.preventDefault (); $ (this) .parent ('div'). remove (); x--; Can someone help me? -- Atenciosamente Juscelino Barão
Abstracting a jQuery selection / making it more flexible
Hello all, please consider the following code, which works fine: function loadElements($t) { //load target selection into DOM if ($.cache()) $t.each(function() { //iterate through elements _ld($(this), $.cache().find("#" + $(this).attr("id"))); //load target element into DOM }); } function _ld ($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());
Element left top positioning in javascript
Hi, I need to know the position of left and top of box inside the window. I got the output for whole window. I need exact position of box in the window.
HELP YOU HAVE A PROBLEM IN MY SLIDER
THİS HTML KOD <div class = "kayar kap1"> <Style> #slider {positon: göreli; kenar boşluğu: 0 otomatik; genişlik:% 100; yükseklik: 250 piksel; taşma: gizli;} #slider img {genişlik:% 100; yükseklik: 250 piksel;} #slider li {list-style: none;} .sliderbutton {position: göreli; kenar boşluğu: 0 otomatik; genişlik: 120px; kenar boşluğu üstü: -25px;} .sliderbutton li {list-stili: yok; dolgu: 5px; arka plan: kırmızı; float: sol; marj-sağ: 10px; border-radius: 10px;}
Asynchronously load the contents of a div
I'm looking for a way to asynchronously load the contents of a whole div. I'd like to delay the loading of everything in the div. Right now, everything is loaded all at once and it's not bandwidth efficient. https://codepen.io/anon/pen/GENGJW
Can’t change div-Tag after load()-response
Hello alltogether I have a problem with my html-JQuery-Ajax project. I have an empty div-Container. <div class="form-group" id="UserDiv"> </div> In this div-Container with the id=“UserDiv” i will load a select field of users, which is generated by a php script. This is the jquery-Function of the call: function loadDiv(){ $("#UserDiv").load("../includes/UserProwalus.inc.php", function(response, status, xhr) { if(status=="success"){ alert(response); $("#UserDiv").html(response);
jquery auto refresh mutiple divs at different intervals
I have tried the following for jquery auto refresh of multiple DIVs at different intervals for each div. But the refresh is happening only for first div and other DIVs are ignored. Can anyone help me for a solution? $(document).ready(function() { $(".div1").load("load1.php"); var refreshId = setInterval(function() { $(".div1").load("load1.php"); }, 8000); $(".div2").load("load2.php"); var refreshId2 = setInterval(function() { $(".div2").load("load2.php"); }, 9000); });
Using serialize to send value to querystring
Hi, I am trying to send value form a html Form by submit to the next page in query string. The values are submitted fine first time, but if I again try to add another value to already added values, I get %20 and %3D etc. in values retrieved. I am using asp to retrieve these values from query string and append to form fields with radio buttons. How to remove this encoding using serialize. The code is given below in form submit. $(document).ready(function(){ $("#form1").submit(function(event){
append an element to a container, why this selector?
I am testing a js that allows adding texts to a container and then animates it through greensock. Looks like the creation of every new text is made through var txt = "Hello World!"; var ele = "#canvas"; var i = 8; var particle = $("<div />", {id:"particle"+i}).addClass("particle").text(txt).appendTo(ele) ; spawn(particle); // this function animates the just-created particle element (the text Hello World!) inside #canvas But, what is code in line 4 doing? Apparently it creates the new element, but
fill input from select not working
Hi ! I want to fill an input type=text from a selected value, there is no js error on the page but my code is not working, input keeps empty I have tried with name or id : same result thank you <script>jQuery(function ($) {$("select[name='selectGroupIds']").change(function() { $("input[name='jform[user_ids]']").eq($(this).index()).val(this.value); }).change(); }); </script> <input type="text" name="jform[user_ids]" id="jform_user_ids" value="" class="inputbox"> <select id="selectGroupIds"
get value input inside append
hi everyone, i've some problem when using append I have no idea to call the value input and dataset in the append HTML <div class="row form-group"> <div class="col-md-12"> <select class="form-control category_id" name="jumlah" id="entity" required> <option value="1" selected="tr">---- 1 Data ---- </option> @for($i=2;$i<=10;$i++) <option value="{{$i}}">---- {{$i}} Data ---- </option>
Javascirpt - remove rows dynamically after 2mins
i am calling a webapi using get method which will give json data and i am display as a table from that data. the code which i have given below is working fine. i got around 25 rows(dynamically" of data when i fit the service. this webpage will be refreshed using signalR. when any changes in DB immediately it should reflect in the webpage. my question is if "" + item.TakeupType + "" value is "Completed" or "cancelled" this row background should change to gray color and after 2mins row should be remove
Set Value Select Option data-
Hi Friends how to set value, searching by data-idperson here my fiddle: https://jsfiddle.net/jamiguel77/v7hz7a0w/ Any Advice? Thanks
Getting a button to target a particular set of items
Hello. I'm (trying) to build a simple flashcard page. The HTML is currently hardcoded with unique IDs. Using the following jquery with for loops I can successfully flip the individual cards, but the code I've written for the 'Toggle all items per section' button targets all the sections no matter which button I click. I've been struggling with this for a stupid amount of time and wonder if any one could point out my error. JS (function($) { // Toggle all items per section (THIS DOESN'T WORK) for
ajax json response from PHP not recognized
PHP server: $result = array(); //declare empty array $result['error']=''; $result['result']=1; $result['crud']='E'; echo json_encode($result); =================================== AJAX $.ajax( { url : "xxxx.php", method: "POST", data : value, dataType : "JSON", success: function(response, status, xhr) { var crudType = response.crud; var dataResult = response.result; if((crudType == 'E') && (dataResult
Using jquery to filter list
I've got a series of divs generated by a wp_query loop, each loop pulls through an individual post contained in a custom post type. Each div contains a few bits of information - yep this is on wordpress haha. So we have a page where all of these posts are listed and at the top of the page I have a few dropdown inputs. I'm trying to use jquery to update the list of divs to only display the ones that contain the information chosen in the dropdowns - ideally running each time the user changes an input.
Trigger the right event when a form opens on a page
My problem is that I don't know what is the right event when a form opens on a page.Specifically, my webpage is as follows: http://pcgraph.triplebit.com/product/on1-jersey-unif/ When the visitor clicks the upper button (with the envelop icon) it launches a form. I need to set a specific value to one of the fields with jQuery at that moment. Is it possible and how? Thx
Cannot add two "Range Date Pickers"
Hi, I am new to development and don't have too much experience. I want to add multiple sets of "Range Data Pickers" on a single web page. I have used the source code from here: http://jqueryui.com/datepicker/#date-range . In my body I have two divs within a CSS Grid. Within them i have to google charts and underneath them the two date pickers. I have them both showing up in their respective places. The first date picker works, when the text field is clicked it prompts for a date to be picked, the
Receiving Internal Server Error on Ajax calls intermittently
I have a MVC .NET 4.5 web application running on 4 servers under IIS. Whenever I login into my web app and select a tab option, a GET request is fired. I am receiving below error when this request is triggered. xhr.send( ( options.hascontent && options.data ) null ) 500 internal server error If I keep refreshing the page, this data is getting returned intermittently. i.e. once it works and the other time it fails. Also, this happens only when I use a load balanced VIP URL. It works fine using a
How can I filter a listgroup of span?
I need to filter a listgroup like this: <div class="list-group pre-scrollable list"> <?php for($i = 0; $i < count($places); $i++) { ?> <span class="list-group-item listPlaces" value = '<?php echo $places[$i]->id_company ?>'> <div class="row"> <div class="col-sm-8 col-md-9"><?php echo '('.$places[$i]->id.') '.$places[$i]->name; ?></div>
Apply second filter on first selected elements?
The standard selection in jquery is $(".foobar").......... Now assume this expression matches multiple elements and I additionally want to filter out some of them. How can I apply a second filter on the results of the first selection? Example: <div class="foobar bbb">....</div> <div class="foobar">....</div> <div class="foobar"><p>sometext</p></div> 1.) filter out (=ignore) all those elements which contain an additional class bbb AND+NOT boolean link 2.) select from the result set only those elements
should we pass event parameter all the time
hi, In following example event parameter is passed in the function . q1) is it optional can we do with out it ,? or it is good paractice to keep it there where it is. $( document ).ready(function() { $( "a" ).click(function( event ) { alert( "Thanks for visiting!" ); }); }); yours sincerely
which jquery files listed below should be changed to being the current version?
I currently have the following references to jquery in a web form 2010 application where I updated the main jquery reference: <script src="../scripts/jquery-3.2.1.js" type="text/javascript"></script> <script src="../scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script> <%If (False) Then%> <script src="../scripts/jquery-3.2.1.js" type="text/javascript"></script> <% End If%> <script src="../scripts/site.js" type="text/javascript"></script> <script
Delete all (brother) elements AFTER a certain element?
Assume I specify a certain element (e.g. with class="foobar"). This element and all following brother elements should be deleted but NOT the brother elements BEFORE Example <div class="...."> <div class="aaa">...</div> ... <div class="foobar"> .... </div> <div class="bbb> ... </div> .... <div class="bbb> ... </div> </div> <div class="parentbrother>...</div> How can I achieve this (keep in mind that no brother elements could follow)? The following (Javascript) code deletes ALL elements
Most current version of json
In a vb.net 2010 web form application, I am in the process of obtaining all the most current jquery references that includes the jquery version 3.2.1. As part of this process, I want to see if I am using the most current json references for json2.js. When I click on the links that are listed below, I get the 404 server error where the link can not be located. /* http://www.JSON.org/json2.js 2009-09-29 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html
use jquery migrate plugins
I have a vb.net 2010 webform application that uses the original jquery libraries. I plan to upgrade to the 1.9 version and followed by the upgrade to the 3.0 version. I am thinking that I need to obtain the jquery core library to use as a reference to my scripts. Basically my reference to scripts are in the following order right now: <script src="../scripts/jquery-1.3.2.js" type="text/javascript"></script> <script src="../scripts/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script>
obtain current version of 3 jquery plugins
In a vb.net 2010 web form application, I am in the process of upgrading all jquery references to be the most current version which is the 3.2.1 jquery library. While I am in the 'core' libraries, I want to upgrade all the jquery plugins to the most current version. Due to that fact, I have the following jquery references in the application, that I would like to know if there is a more current version that I can use from the following jquery items listed below: jquery.validate.pack.js jquery.validate.js
window.load event not getting fired when I open a link in a new tab
I am opening a link in new tab using **Ctrl+click.** Simultaneously I am opening 6 to 7 tabs. On few pages I am getting it and on some its not working. **Browser - Chromium ,Version 53.0.2785.143 Built on Ubuntu , running on LinuxMint 17.3 (64-bit)** This is the my code. $(window).load(function () { alert('here'); }); What could be the possible issue ? Basically I want to fire an event when whole page is completely loaded.
how to using jQuery to meet a string deep copy
Hi: I have a problem about deep copy. Instead of using javascript slice(1), is there any other way to deep copy a string via jQuery, such as var str=deepcopy(old_string) Thanks a lot.
Disappearing <br/>
I'm setting up a dynamic form. As such I am placing many br tags in various places. My last part of the form is behaving strangely. I notices that some br s where missing. So I stepped through my code with the chrome debugger and I found the strangest thing happening. It places the line break no problem, and continues to place all the various elements after the break. But when it gets to the next line break, the previous line break disappears. (it get removed entirely as an element, and in the browser
another problem with list
Hi there, hope you got an amazing christmas gift. this is my problem: I have a year list, when I click on an element of list, I send the data by ajax to php, and refresh the page with new data. this is working perfetcly. On my list I start with a simbol near the current year. If I click on different year I would that the simbol apper only in the year that I clicked. I can't achive this. <ul class="dropdown-menu"> <li class="header">Esercizio Contabile</li>
Loading a html part with a script with .load() does not work
Hello, I am trying to use jquery.load to load a file with an embedded codepen, that is made resizable by a script called resizable.js. the resizing on a ingle page works fine (>resizable.html). As soon as I load that part of the page including the script, it doesn't work anymore. In the attached files you can find the resizable.html file showing the possibility to resize the codepen by clicking in the right bottom corner. Bit if I load the part of the page with the script in the file Load_resizable,html
How to get value of Form Element to Validate
Need to get the value from Form Elements to validate. Not sure what works in jQuery. Have tried this (below) but it gives an error "formElement.find(" is not a function. function enableFastFeedback(formElement) { var nameInput = formElement.find("#name"); var passwordInput = formElement.find("#password"); var messageInput = formElement.find("#message"); var checkboxInput = formElement.find("#checkbox"); nameInput.blur(function(event) { var name = $(this).val();
Help Needed With My jQuery & CSS Exit Popup Modal....
So I have this code, but it does NOT trigger the way that I would like it to. I'm new to learning jQuery (a month or two) so I'm still not 100% with understanding this code that I have. The code is supposed to create an "exit popup" to help folks learn about my subscribers newsletter, but it doesn't open if you scroll down the page & then try to exit. It only fires off if you are at the top of the page & then try to move off to click on the exit tab. I need the code to fire off even when the user
change color active menu one page menu
on this website: http://www.nieuw.yazmin-enschede.nl I'm using a one page menu. I would like to have an active option (change menu color) when you click for example the menu-item 'service' I have an active css color but this is not working with the one page option.
Removed rows are still there making it difficult to target row I want.
I have rows that I am trying to remove, then auto-open a link on the row that is then in the first spot. The problem is its opening the link thats in the first row that I removed- like its still there.Does remove actually remove? It seems like it is not actually removing. // if row contains any keywords in array then remove row (array here) var o; var goodlen = good.length; for(o = 0; o < goodlen; o++){ var x = good[o]; $("span:contains('"+ x +"')").closest("div").remove(); //-------auto open link
Add Ctrl keypress for hyperlinks
We have hyperlinks that reside in a tab solution. These hyperlinks are coming from a different domain. If the user clicks these cross site domain links, an error occurs. If the user holds down the Ctrl key, the links will open correctly. Is there a way via some js/jQuery code we can add or implement the Ctrl key press action on all hyperlinks for a specific DIV. Thank you!
How can I make my fullscreen menu overlay jump to top before it is opened?
Hello! Happy holidays! :-) I am using the following for a fullscreen overlay navigation. // Menu variables var $menuTrigger = $('#brgr'); var $menuArea = $('#menu'); // Header variables var $headerLogo = $('header > .constraint > .logo'); var $closeIcon = $('nav#menu > #menu-area a.close'); var menuOpen = false; $menuTrigger.on('click', function () { if (!menuOpen) { $(window).scrollTop(0); $menuArea.addClass('is-open'); $headerLogo.addClass('is-open');
Next Page