Cross-site scripting (XSS) vulnerability
Hello, We are using jQuery 1.6.2 and with other plugins listed below: jquery.dataTables fileUploader jquery.layout-latest jquery.multiselect jquery.raty jquery.tokeninput jquery.tools jquery.ui.combobox jquery-1.6.2 slides.min.jquery jquery-ui-1.8.16.custom issue # 1: Cross-site scripting (XSS) vulnerability in jQuery before 1.6.3, when using location.hash to select elements, allows remote attackers to inject arbitrary web script or HTML via a crafted tag Can you suggest, to which version of jQuery
Reading Query String from Ajax Load
I have seen some examples for url reading but all are from window.location In my case I can't use window.location.search because I am doing an ajax load into div. $( "#result" ).load( "service.html?param1=1¶m2=2"); In this case how can I read the param1 and 2 values when I am inside service.html?
Exception was thrown at line 3670, column 8 in https://code.jquery.com/jquery-1.12.4.js
With jQuery 1.12.4, When compiling and running the project in Visual Studio 2013, I get a ton of: Exception was thrown at line 3670, column 8 in https://code.jquery.com/jquery-1.12.4.js 0x8000000a - JavaScript runtime error: The data necessary to complete this operation is not yet available. and these: Exception was thrown at line 745, column 2 in https://code.jquery.com/jquery-1.12.4.js 0x800a1396 - JavaScript runtime error: Array.prototype.slice: 'this' is not a JavaScript object Exception was
Preventing .ajax POST from navigating away
Hi everyone, I am testing the following: <?PHP if(isset($_POST["Submit"])) { echo "I am inside"; some PHP code stuff....... } ?> <script> $("#ftpForm").submit(function(event) { event.preventDefault(); $.ajax({//Inside Ajax method: "POST", url: "index.html", data: {Submit:"Submit", Data1:"data1", Data2:"data2", Data3:"data3"} })//Inside Ajax }); </script> Apparently, the post seems to be occurring because the page leaves the tab that I am in and sends me back to the 1st tab, which is the
Scroll Down after content loaded
I'm loading 'more news' to my page via a ajax call. Currently I load 30 items onto my page when loaded, this fits into a single page view. at the bottom I have a button which loads another 30 via ajax What I now want is for the 30 to load and for the page view to scroll down so just the 30 new are showing. Any ideas?
Passing username portion of email address to hidden field
I'm trying to pass just the username portion of an email address to a hidden field. Here's what I got so far: jQuery(document).ready(function(){ jQuery("form").bind('submit',function(e){ e.preventDefault(); var formEmail=jQuery("input[name=email]").val(); jQuery("input[type=hidden][name=hidden_email]").val(formEmail); alert(jQuery("input[type=hidden][name=hidden_email]").val()); alert(formEmail); }); }); <form method="post" action="#"> <input type="text" id="email" name="email"/> <input type="hidden"
Can't see ajax headers, parameters or results in firefox console
am working on modifications to a web app. The production app can be seen at http://finder.passaicschools.org. We are making changes in the district and I am updating the app to accommodate the changes. I have three environments. Development (windows 7), test (Ubuntu Linux Server) and production (also Linux but it is a host so I am not sure which version). I made my changes locally and everything works great. I uploaded the new code and database to my test server and the Find feature on the main page
Fill fields with info is not working properly
When the checkbox "Fill with auth user info" is clicked I want to populate the fields with the auth user info (name and surname) but it's not working. When the checkboxes are clicked is not working the fields are not populated with the auth user info. Do you know where is the issue? What I have for now is in, https://jsfiddle.net/LahL166o/ the auth user info appears in this span <span id="userData" data-name="John" data-surname="Keane"></span>
Executing a PHP file in a Modal Popup
I currently use a very small simple javascript popup function that passes parameters to a PHP file and opens that PHP file (ShowTheReviews.php) in a popup window to display reviews of a product. It works perfectly on desktops, but is not responsive, and not mobile friendly and opens a new window/tab on tablets and smart phones. Looking for a replacement that does a Model popup that overlays on the current page. Can anyone suggest a way to modify (using Javascript or JQuery) this popup function to
Even and Odd Selector filters are not working properly
Hi, Hope you are doing fine. We are using Jquery version 3.3.1.Below is the explanation about the bug. This our javascript Code $(function(){ $("p.myp1 span:even").html("this is text using Class Name") }); This is our Html Code. <p class="myp1"> <span>My 1 Span</span> <span>My 2 Span</span> <span>My 3 Span</span> <span>My 4 Span</span> <span>My 5 Span</span> </p> While I tried to select even elements then its selecting odd elements . And same as while i tried to select odd elements then its selecting
Slide Left/Right
So I can slide a div up and down, is it possible to do left right? or essentially rolling it out from the left hand side of the screen? i'm using the animate function and changing the width at the moment. Is this the best way?
Slidetoggle-issue
Hi dudes ;) I got a "issue" here with slidetoggle().. Lets say i have a div with some font awesome ocins. when i clicked them text slides up/down in this div. -and that's "no worries" <div id="textbox"> <li class="something"><i class="fa fa-something"></i></li> | <li class="somethingelse" <i class="fa fa-somethingelse"></i></li> </div> and when icon 1 or 2 are clicked it toggle some text: <p id"text1">text1</p> or <p id="text2">text2</p> and the jquery i use for toogle different
Getting price from a price table based on X and Y
Hello, I've been trying to calculate a price for a product based on width and height for a while but I can't figure out how to approach it. The basics of what I need to do is having two input fields. Get the values from these and then get the price from for example an external CSV file where the input values intersects. What I've got so far is just the basics, input fields where I get the values, and then just a simple formula based on the input values. <html> <head> <title></title> <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
Forcing radio button to NO based upon select box selection
I'm trying to force a radio button to be selected to No based on country selection, while also disabling the ability to change it. Australia and China aren't eligible for Rush, so the radio has to default to No without the ability to change it... unless the country is changed. <select id="country" name="country" class="form-control" required="required"> <option value="" selected>-- Please Select --</option> <option value="AU">Australia</option> <option value="BR">Brazil</option> <option value="CA">Canada</option>
How to replace CSS key with matching criteria? No class or ID reference
Assume I want to replace all CSS keys line-height: 24px; in all CSS rules (for unknown classes or IDs) by the following key line-height: 20px; resp. (if necessary): line-height: 20px !important; How can I achieve this with jQuery? The following seems not to work: $("['line-height=24px;']".css("line-height","20px !important;"); How can I achieve this otherwise?
Memory size is keep on increased in every navigation of jQuery ajax call.
Initially the application size is 42 MB, but it is increased gradually from '0.5 to 1' MB for each navigation. After some-while the memory will not released to its initial stage. It is retained in 68 MB (the GC is not released the memory). - We have investigated with Goggle developer tool (F12 - Memory): the 'Detached DOM control' (of the previous navigation) are not released. Also there is no circular references (It is confirmed with two Snapshots). The recent changes are, - We supported the
Change active tab when the user clicks in a specific link in another page
I have this link "http://proj.test/congress/1/congress-test/registration " where the user has a form to register in a congress. Its a muli step form, in the step 2 there is a message informing the user that he was registered with success.In this message there is a link "My Tickets": <a href="user/profile">My Tickes</a> When the user click in "My Tickets" he goes to " "proj.test/user/profile?user=1" that is the page to edit some user account settings. In this page there are some tabs like "General
How jQuery parses the DOM
Hello, In the context of a web page with many div tags and some having a class of "changethis" as in: $("div.changethis") If I wanted to change the text appearing inside of these as in: <div class="changethis">This text</div> to: <div class="changethis">Hello</div> I would use $("div.changethis).text('Hello'); So using this context and the .text method, the question is: How does jQuery ( under the hood ) parse each node to find what to change and what not to change. Is it an iterative process that
How to fetch all <div> with an id beginning with "banner"?
How do I fetch all <div> elements which have an ID starting with the string "banner" (without quotes)? I tried (mind the wildcard *): $("div#banner*")...... but was not successful. Sample element to fetch: <div id="banner21523456236" ...>...</div>
how to define height and width image befor loading like the lightbox plugin?
Hello... how to define height and width of image before loading Like lightbox? Some tutorials are that, they will get the image as a tmp or chach, then measure its length and width. But this method is delayed if the file is larg! The length and width of the photo must be obtained before loading like the lightbox plugin. please guide me. Thanks
Problem in ie browser
Working in ie simple jquery code like $('#descript').html(str12); go to this problem : In picture word(in russian) школа change to шко?ола. str12 is string where школа is It is like something interupted process, inserted 2 symbols and then renewed it again To my string I get two anorher symbols - ? and о (last symbol before interuption)
.attr(): type property can't be changed
I am trying to change input type from password to text but I am getting the error in the subject. $('#password').attr("type", "text") This is strange because this fiddle seems to be working: http://jsfiddle.net/bgLtoqgj/ Stackoverflow didn't help to clarify: https://stackoverflow.com/questions/8378563/why-cant-i-change-the-type-of-an-input-element-to-submit Any ideas?
How to remove empty <p>...</p> but with possible attributes?
Assume I have the following simplified source code: <p> </p> <p style="line-height: 12px;"> </p>Both <p>s contain inside only whitespace chars. Here it is a blank. It could be a tab or nbsp as well. Now I wan to remove all empty <p>s resp all those which contain only whitespaces. When I try the following (pure Javascript) code: document.body.innerHTML=document.body.innerHTML.replace(/<p>(\s*| |&tab;)<\/p>/g,""); then only the first <p>...</p> is removed. How can I extend the command that the
how to create multiple div's dynamically, so that it has to create multiple columns(TODO,INPROGRESS..)
I need to create multiple columns(4 columns- TODO, INPROGRESS, RESOLVED, DONE) dynamically using jquery(with the help of div's)
Moved footer to header .And Sorting taking place when trying to filter the dropdown
Dear All, In my fiddle I had moved my footer to header , But sorting is taking place when I try to filter the column. For that I had created another thead and trying to point the sort to newly created thead by following the url which is exactly matching my requirement I tried adjusting the the below code. But find no luck can any one please do let me know what's the issue $('#example').DataTable( { initComplete: function () { this.api('thead tr:eq(1) th').columns().every( function
Jquery virtual scroller / feed manager
I'm working on an app that has a feed with cards (like facebook or twitter). I've been looking for a plugin that has most of the code working. I've found two: endless-scroll which was last worked on in 2013 and jscroll which is also 4 years old and is a complete kludge of code and documentation. Does anyone know of any form of plugin or example code for a virtual scroller or feed manager? Thanks, P. (BTW, that 2 word search bug still exists in the forum search bar!)
JavaScript and Items value setup
Hello there, I have a value from 1 to 10 that i receive and then I have 10 item boxes that need to be populated lets say with the values 1 to 10 depending on which value was sent Im trying to do something like this but it doesnt work with javascript. Is there a way to do it with jquery? document.getElementById("item"+v) = "12345"; document.getElementById("item"+v).value = "12345"; //item1.value = 123554; this work but I want to do it by getting the number from the one
JQUERY Problem with multiple selects and multiple item boxes
I have the following 3 select boxes that have a value from A to C. On the right side I have 3 item boxes which are empty. My select drop down are created depending on the count that i have on my table which is 3 now but can have more than 3. Everytime that someone clicks on a select and choses from a to c. I need to input the value on the box. Example, if the person choses A then I put First, B Second and C Third. My question is that I don't know how to do this change even with JQUERY and how does
Force a POST
Hi everyone, I have a PHP function that queries data from MySQL table. In order for it to work a POST needs to occur, because I Really haven't figured out how to do this another way. So, how can I force a POST from my JavaScript? Example: PHP code { .... } <script> JavaScript code Force POST </script> I don't know if this make sense, but Let me know if there's a better way? Thanks Neil
JQuery Change event right row problem
Hello I have a loop that will create drop downs (selects) depending on how many items I have on my list. I have a field next to the selects that will show what I selected on the left side. For example if I click 1 it will display One, 2 it will put a Two value there on the second item. My problem is that I don't know how to use the change event so I can trigger the right select. Do you know how to do that with jquery or just by doing a $("select#p_list").change it will know which select im clicking
Pinned tab data restore
Hi all, In my work space, i have input field date with min and max attribute. The max value which i set is current date. If i have pin tab of my web page and open my page, the max field is not updated(showing yesterday's date). After refreshing the page only it will be updated. So, my question is, Is there any method/way to get max field date(current date) without refreshing the page in pin tab in browser?
Intermittent issues
Has anyone else noticed intermittent issues connecting to https://code.jquery.com/jquery-*.js ? The issue appears to have started yesterday, just seeing some calls taking longer than 30 seconds to respond. ~ curl -v https://code.jquery.com/jquery-3.2.1.slim.min.js >> curl.txt % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
Autocomplete css is missing for dynamic elements
Here is the css : <style> .CitiesAutocomplete { list-style: none; background: #fbfbfb; border: 1px solid #5f5f5f !important; width: 350px !important; position: absolute; z-index: 10000; border-top: none; min-height: 25px; max-height: 250px; overflow: auto; cursor: pointer; padding: 4px 0; } .CitiesAutocomplete li { padding: 2px 6px; } .CitiesAutocomplete
(How to avoid?) jquery load method cause multiple event trigger in sub page
I use jquery load method to load sub page from another file to act as a template system, the code simplifies as following: simple.html <ul> <li><a href="#" onclick="loadMessage('Welcome Home')">HOME</a></li> <li><a href="#page1" onclick="loadRoute('page1.html')">Page1</a></li> </ul> <div id="app"> </div> <script> function loadRoute(url) { $("#app").load(url); } function loadMessage(message) { $("#app").text(message); } </script> page1.html <div class="tag"> <h1>Page1</h1> <script>
Show a "please wait.. loading"-gif when link to anchor is clicked
Hi Coders! i'm new to using jquery, but i use this code for scrolling to anchors when anchor-links are clicked : ----------- $(document).ready(function($) { $('a[href*="#"]:not([href="#"])').click(function() { if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if ($) { if (target.length) { $('html, body').animate({ scrollTop: target.offset().top
Unable to reference variable inside animate method
I have the following function: $("#scroll1").click(function () { var scrollId = $(this).attr("id"); $('html, body').animate({ scrollTop: ($(scrollId).offset().top-100) }, 500); }) When this fires I get: Uncaught TypeError: Cannot read property 'top' of undefined This is on my variable reference in scrollTop: ($(scrollId).offset().top-100) How can I reference the scrollId variable inside my .animate?
How to remove and add a new ID to a element dynamically.
Hi, is it possible to change the ID of a element on a click of a button? For example if I have the following code; <button id="displayOpt1">Click Here</button> When "displayOpt1" is pressed I want to change the id to "displayOpt2" - this would render the displayOpt1 button click redundant. Thanks in advance.
datepicker Calendar all days not clickable
Hi, I have an event calendar. It´s shows me the days that are booked/free. It works great too. I would like to go over it with the mouse without being able to click the days. I do not want to be able to click the days.. Is that possible? Hier my code. <script type="text/javascript"> var highlight_dates = ['1-3-2018','1-4-2018','18-4-2018','28-4-2018']; $(document).ready(function(){ $('#datepicker').datepicker({ beforeShowDay: function(date){ var month = date.getMonth()+1;
remove element when you don't need it
i have 100 links has an id='a-list-*' user will added a list link unknown number < 100 has an id='e-list-*' if a user added a 10 lists i have 90 links left in my code so i need to remove it When I run this code I get an error . for (var i = 0; i < 100; i++) { $( '#e-list-'+i ).clone().appendTo('#a-list-'+i); if ($('#e-div-'+i).length) { $( '#a-list-'+i).parents().remove(); } }
How to only change to step 2 if there are no validation errors in the step 1?
I'm trying to create a multi-step form using jQuery AJAX and I want to validate each step with an ajax post request. In the step 1 form, when the "go to step 2" button is clicked if there is a validation error in the console network tab it appears: {success: false, errors: {buyer_name: ["The buyer name must be greater than 1 character."]}} errors:{buyer_name: ["The buyer name must be greater than 1 characters."]} success:falseThis is ok. But even this error appears the user goes to the "step 2"
Next Page