using variables as attribute value in selector
Hello, I am trying to use variables when specifying an attribute value in a selector statement. so for example var myVariable = 985; when I use: $("tr[iid*='985']").text() she works fine. but when i try to use a variable representing the string 985 she don't. $("tr[iid*=myVariable]").text() Can anybody please help if there is a way to use variables to specify strings in this type of selector? I just don't get it. thanks -dave
Difference in the code
Hi What is the difference between the below code. <html> <head> <script type = "text/javascript"> $(document).ready(function () { $("#btnClick").click(function(){ alert("hello"); }); </script> </head> <body> First name:<br> <input type="text" name="firstname" value="Mickey"><br> Last name:<br> <input type="text" name="lastname" value="Mouse"><br><br> <input type="submit" id ="btnClick" value="Submit"> </body> </html> ------------------------------------- $(#btnClick).bind('click'(function(){
Dropdown menu not disappearing once clicked
Hi Could someone please help – how would I get the following dropdown menu to disappear once the selection has been made? (view on mobile only) http://www.clairecessford.com/clients/Rawlins_George/index.html Many thanks, Claire
Inserting a value into text area?
Okay since I'm inserting the value into textarea, Here is the updated codes. Here are the codes below, <script> var string_ans = '<?php echo $ans ?>; $(function () { $("div #right-answer").hide(); $("div #reference").hide(); $("#done").click(function(){ $("textarea #right-answer2").val(string_ans.val()); $("div #right-answer").show(); $("div #reference").show(); }); }); </script> It is not inserting the value into textarea? What's the reason? Thanks in advance.
CSS class in jquery
I want to apply a CSS class to a gridview. I tried to apply this style reference link, so I try this success: function (result) { var final = JSON.parse(result.d).response; console.log(JSON.parse(result.d).response) $("#tabledata").empty(); if (final.length > 0) { $("#tabledata").append( "<tr><th>ID</th><th>OwnerName</th><th>RegNo</th><th>MileageAccumlation</th><th>MaxSpeed</th></tr>");
Promise returns undefined
Hey there, I'm struggeling with a function of mine and I dont' quite know why, as this method seems to have worked so far for other functions. Basically I'm getting Objects from a SharePoint List and return all the Values in common. Somehow in my returned variable my "Result" is always undefined. When I make a breakpoint at the deferred.resolve() result is correctly defined but somehow it doesnt get out. Maybe someone has an idea where I'm doing it wrong. I also tried the resolve in a seperate chained
Jquery Supported Version
Hi team, I am new to Jquery world. Wanted to know, what is the least version we still support (by saying support I meant, in case any issues we face, will your team still look into those issues and provide us the right direction). We are currently on Jquery Core version 1.9.1, and are evaluating the most stable and supported version where we can move to. Thanks for your help! Abhishek M
Help with broken jquery image fader
Hi, I am new here, I am posting to figure out why the "Cycle2" script from http://jquery.malsup.com/cycle2/ is breaking for me in Firefox and other browsers, but is still working in Safari? I don't know enough to troubleshoot this and any help is appreciated. The page is at www.monsonfirm.com I am using the script in Wordpress. Everything has been working fine, for a few years in fact, and just recently the plugin stopped working in Firefox. I am not sure of the exact date. Just in case, I followed
ReferenceError: $ is not defined on Mozila version 47
Hi, Please refer the attachments for code and error.I am getting the below error on Mozila version 47 ReferenceError: $ is not defined.. How to resolve this error
Inserting whitespace into a textnode
I am trying to change a HTML header from this: Reaction Tester using jquery, my javascript file has this code: $("h1").text("Score: Best: Avg: "); The whitespace I had in the jquery text method string is compressed of whitespace and ends up looking like this: Score:Best:Avg: Please advise.
Add Label and IDs
Hello, We have an auto generated form in 3DCart and code is like this <div id="OptionsBlock"> <input type="radio" name="option-617" onclick="validateValues(document.add,1);selectOption(this);" id="72"> Option 1 - This is a text here <input type="radio" name="option-618" onclick="validateValues(document.add,1);selectOption(this);" id="73"> Option 2 - This is a text here <input type="radio" name="option-619" onclick="validateValues(document.add,1);selectOption(this);" id="74"> Option 3 - This is a
make canvas as mandatory
I have free draw canvas with me, I want to make this as mandatory in such a way that, if canvas has some drawings than and only than it should go to next page, else it should prompt message. Please advise. Thank you.
how to seperate loop array values in different arrays
Hi I am trying to display multiple arrays like this ["A,","B"] in next line ["A"] when check box is selected. But I am getting error in firebug like this.. (plz see below image) [{ "acdyr1": "2012", "acdyr2": "2013", "med": "kan", "type_of_skl":"STATE", "class_section": [ { "standard": "UKG", "sec": ["A"] }, { "standard": "C1", "sec": ["A","B"] }]
Loading Images 50 at a time
I have a page, I want to load up to 900 DIV's (containers for images). The number of DIV's is unlimited but would likely only every be a maximum of 1,000 - 2,000 and even this is extremely unlikely. I want this page to load with all DIV's initially. I want images to load, 50 or a 100 at a time and loaded into the appropriate DIV for that image. Not based on the user scroll but just one after the other. Using AJAX I imagine. Any ideas?
Understanding the workings of a script ?
Hi, does the following code not allow me to style ID or classes within a SVG file externally, externally being either a external style sheet or or embedded style sheet ?
Ajax Form 'POST' result as 'GET'
Hello everyone, I'm learning some Jquery on a website and I was trying to understand how does it work ajax used with forms. I created this simple form which should send all the data using POST: <!DOCTYPE html> <html> <head> <title>Ajax Form</title> <script src="http://code.jquery.com/jquery-3.0.0.js"></script> </head> <body> <div class="row"> <div class="col-md-12"> <h1>Ajax Form</h1> <form> <label for="destinatio">Destinazione</label> <select name="destination" id="destionation"> <option value="londra">londra</option>
How to remove a clicked button after it is clicked
I have made this code here: http://codepen.io/anon/pen/EyoXVy what I want to achieve is once I click on a button that button dissapears, (and all the other buttons shift) However with the jquery remove method it removes them all, I've also tried using a style to set the visibility to hidden which removes the specific button however does not shift all the other buttons to fill the gaps
Ajax async file upload with redirect
Hi All, I am trying to upload file where I am having few conditions to satisfy 1. Ajax Call is asynchronous. 2. User should not be waiting to get file uploaded, Uploading process should be in background. 3. User should be redirected to next page as he submits form. Here's what I am trying to do. ___________________________________________________________ $("#Apply_Now").submit(function (event) { event.preventDefault(); var data = new FormData(); var firstname = $("#firstname").val(); var
How to auto increase timer
So I have this button grid On each button there is a timer on the top right in the form mm:ss however I dont how to auto increase all 9 buttons at the same timer, I'll also be adding in some more buttons dynamically via ajax so I need the method to work for any added button. I'll also add that the buttons are being removed from touch so the timer cant be for inviduvial buttons, if that makes sense http://codepen.io/the133448/pen/KrkqzO Sorry use that link.
better marquee
Hi, I took a tutorial at Lynda.com. This helped me understand actual use very well. Up to now only reading not using. I understand this code decent. My questions are these. How would you get this code to do a animation that moves the picture (marquee) on the stage then off the stage? Do you need to employ jQuery easing for this? I would like to know how to make the marquee (doing a picture on and off the stage) loop infinite and go in either direction when clicking on the buttons. This code does
Automatic down scrolling
Is possible use JQuery to scroll down my web page without user interaction? Let's say that my web page have a larger height of what the screen can show (in the screen you can only see the 30% of the web page height) so what I need is that the view scroll down and then scroll up but the web page have to do that by itself. How can I do that using JQuery?
Identifying 'Change' Correctly
I'm trying to show an ajax loader just below the toggle switch (checkbox) that has changed its state. There are about 4 switches / checkboxes. My code is this: (function( $ ) { 'use strict'; $(function() { //Monitor toggle and trigger AJAX to update app status $(".app").on('change', function () { //Show the ellipsis loader below the toggled checkbox $(".app").bind('change', function(element) { $(this).parents(".price-box").find(".uil-ellipsis-css").show(); }); var appStatusData = $("#io_dashboard").serialize();
Using length vs not using length
Hi, Is there any difference between: var nameValue = $('#edit-name').val(); if (nameValue) { $('#edit-name, #edit-pass').addClass('withValue'); } And this: var nameValue = $('#edit-name').val(); if (nameValue.length) { $('#edit-name, #edit-pass').addClass('withValue'); } Thanks
JS script dont send cookies
Hello. There is a web page with JS script (use Jquery 2.1.4). The page is located on my PC. 1 ) JS script do get request via ajax to PHP script. The php script located on internet web site. 2) The PHP script return header: Set-Cookie PHPSESSID=r9uu08ora41aaogsulop11kdb1; path=/ 3) So JS script send next ajax GET request, but cookie not send. Why ? Help me please. PHP sent header('Access-Control-Allow-Origin: *') JS see like: console.log('request 1'); $.ajax({ url: "http://site.com/index.php", beforeSend:
SlideDown does not work first time
Hi I have a little bug on one of the pages I created. under http://new.vonarburg.co you see the images of the projects. there is a mouseover with a slideDown, open sideways animation and reverse. But if you take a closer look, you'll see that the white line suddenly appears the first time but on mouseout it does slideUp as desired. the second time you hover over the same image, you'll see that the line slides down from the top left corner. has anyone a solution so this works on the first try? the
Latest Jquery (currently using 1.7.1 and 1.7.2)
Hi An application is currently using Jquery 1.7.1,1.7.2, .I want to upgrade to latest version of Jquery. Can you please let me know the latest version now and what are I need to download to replace 1.7.1,1.7.2. Thank you, Vinay Kumar
Triggering Ajax On Toggling Of Any Of The Checkboxes
I have a set of 5 checkboxes and I wish to trigger AJAX action whenever any of the checkbox changes its state. <input type="checkbox" class="app" name="app_one" id="app_one" value="1"> <input type="checkbox" class="app" name="app_two" id="app_two" value="1"> ...and so on. The code I wrote checks if the checks if checkbox one is 'checked' upon click and then triggers ajax. $("#app_one").click( function() { if($(this).prop("checked")) { var appStatusData = $("#io_dashboard").serialize();
Triggering JQuery Script At Specific Page Width Is Not Working As Expected
I have a responsive page that rearranges its layout depending on the user's screen resolution. I'm using jQuery insertAfter(), insertBefore(), addClass(), and removeClass() methods to rearrange various elements on my page. I have posted the markup, scripts, and css to this question before but received a few replies and none of them was helpful to solving my problem. The problem I'm having is that the script does not work at the page width specified in my if statement. Instead, the script is triggered
Variable as command not working?
Hi I bet this is simple for most but it's just killing me and cant figure it out... This is not working... var append = "append"; $("#table").eval(append)( $( item.row ) ); Neither does this... $("#table").window["append"]( $( item.row ) ); This is working... someVariable = 'alert'; window[someVariable]('Foo!'); How can I make the first one work? I need to pass eigher append or prepend to the command.
Uncaught TypeError: Cannot ready property 'ChildNodes' of Null
When I try to add "<br /><br />" after the first table closure I get the error Uncaught TypeError: Cannot ready property 'ChildNodes' of Null however if I add it before the second table, it works perfectly fine. I do not understand why and would like to know more as I fear there is a possible problem with my script somewhere causing this problem. https://jsfiddle.net/ee77Lnfa/
Navigation hide on scrolling [smartphone tablet]...
Hello, i using a responsive menu (navigation). On smartphone or tablet if i scroll over the opened menu it hides automatically... Don´t understand why, but i think the problem has to do with multilevel dropdown. If i uncommend: /* cssmenu.find('li ul').parent().addClass('has-sub'); multiTg = function() { cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>'); cssmenu.find('.submenu-button').on('click', function() { $(this).toggleClass('submenu-opened');
Loop not stopping
JSFiddle My script is to calculate a pension via putting in a fixed amount from the day you start employment until the last day based upon pension age, so my DOB is 25/12/1991 therefore if I retire at pension age of 68, it'll be on 25/12/2060. function hello(){ var i; var t = 50; var f = 0; for (i = 0; i < CalcY; i++) { f = ((t*52) + f) * 1.08; $('#collection').append("<li>Year: " + i + " Amount: £" + (f).toFixed(2).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,") + "</li>"); } TotalPension = ((t*CalcW)
Why does "click()" not work here?
Have a look at the following (german) webpage: https://www.wikifolio.com/de/de/wikifolio/esi893 When you goto section "Handelsidee" and click on the minus sign right of it you can collapse the section. See the following code snapshot: http://www.picfront.org/d/9qjt I want to automate this when I visit the web page. When I code therefore: $('div.accordion-header.collapsed[href=#collapseOne]').click(); then this collapse action does not work. Why? Peter
jQuery toggle issue
Greeting all, I have a bit of an issue that I cant seem top figure out. I wrote a toggle script and it works great when it is the only instance on the page but if i add another the first instance stops functioning and the other just opens and closes on click. You can view a screencast here http://screencast.com/t/FyKBYhD0z Thanks for any help you can provide. $(document).ready(function($) { $('#accordion').find('.accordion-toggle').click(function(){ $(this).next().slideToggle('slow');
Any other frameworks like jquery autocomplete
Hi have came to know jquery autocomplete frame work it works good and after that i have seen the frame works like select 2 and chosen. Any other frame works like those above which works like legend.....?
jQuery.expr[":"] is now jQuery.expr.pseudos
Using the jQuery 3.0.0. migration skript, i got the message jQuery.expr[":"] is now jQuery.expr.pseudos. Seaching in jQuery API about "pseudos", i got zero results. I think, selectors like :hidden have changed? How I have to write it now? I cannot find annything in the API, that match to "pseudos".
Multidimensional array as pivot table
I'm trying to convert this array var data = ["a","b","c","d","e","a","b","b","b","c","d","d","e","a"]; into topics [a:3,b:4,c:2,d:3,e:2] ( -- not sure how this notation should be) but how? this is my script, not working of obviously var data = ["a","b","c","d","e","a","b","b","b","c","d","d","e","a"]; var topics = [,]; for(i=0; i<data.length; i++){ var arrayIndex = $.inArray(data[i], topics); if(arrayIndex == -1) // return -1 if it is not in the list {
Character-Limit for Textareas
I'm trying to add a Character-limit on all Textareas using this code: var limitNum = 40; $('.textarea__field').keyup(function(limitField, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } }); Why it's not working? Thanks
Menu slide in/out isn't working! Need help!
Hey. I followed everything on doing a menu slide in and slide out from the left side. But it is not working if i click on the menu icon. Could you please help me? index.html <!doctype html> <html> <head> <title>Testpage</title> <link href="style.css" rel="stylesheet" type"text/css" /> </head> <body> <header> <div id="sidebar-btn"> <span></span> <span></span> <span></span> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
How can I disable and enable button in Internet Explorer Browser ?
Hi, I have Two Button but1,but2 at starting time but1 will enable and but2 will disabled.When i click but1 then but2 should be enable and but1 should disable. I am giving my code below it is working all browser except Internet Explorer .Please give me idea what should I do? When I click on button then i want to disable another and disabled button should enable .But in Internet explorer not working. My CSS is input[type="submit"][disabled] { width: 200px; cursor: pointer; background: #61a59c; background:
Next Page