w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
require.js with jquery ui, not finding jquery
You first need to define the jquery dependency: define('jquery', [], function () { return root.jQuery; }); Then you can use 'jquery' to load other libs depending on jQuery.

Categories : Javascript

jQuery
  • index finding
  • Start at the img and work your way up: $(".es-carousel").find("img[src*='something']").parents('li').index(); http://jsfiddle.net/zyvTD/

    Categories : Javascript

    jQuery finding data from div tag
    .find() looks for descendants of an element but in your case the closest div is itself the .btn-group, so you can just filter closest() to make sure you get the div with the class you need $('.paid-today').click(function(){ alert($(this).closest('div.btn-group').data('pay_for_month')); });

    Categories : Jquery

    Finding whether checkbox is checked or not using jquery
    try this: select :<input type="checkbox" id="someId" name="someId" value="" checked /> <input id="btnSubmit" type="button" value="Submit"/> $("#btnSubmit").on("click",function(){ if ($("#someId").is(':checked')) { alert("checked"); } else { alert("unchecked"); } }); working fiddle here: http://jsfiddle.net/tLebs/1/ i hope it helps.

    Categories : Javascript

    Finding a property of jQuery element
    You need to use .attr() here because, target is an attribute here var classNames = parent.find("input").attr("target"); or var classNames = $(this).prev().attr("target");

    Categories : Javascript

    Finding closest element without jQuery
    Here's how you get the closest element by tag name without jQuery: function getClosest(el, tag) { // this is necessary since nodeName is always in upper case tag = tag.toUpperCase(); do { if (el.nodeName === tag) { // tag name is found! let's return it. :) return el; } } while (el = el.parentNode); // not found :( return null; } getClosest(th, 'tbody');

    Categories : Javascript

    Finding matching selector element within jQuery.on()
    Your .on() call is using the delegated event syntax with the '.foo' selector specified, so jQuery will set this to the .foo element. $(document).on('click','.foo','click',function(e) { console.log(this); }); As explained by the documentation: When jQuery calls a handler, the this keyword is a reference to the element where the event is being delivered; for directly bound events this is the element where the event was attached and for delegated events this is an element matching [the specified] selector. (Note that this may not be equal to event.target if the event has bubbled from a descendant element.) Note that specifying 'click' in the third (data) parameter of .on() is kind of redundant. If you will be calling the same function for more than one type of event you can get t

    Categories : Jquery

    Finding value of textbox in same row as clickable element using jquery
    <script> $(document).ready(function(){ $(".btn-primary").click(function(){ qty = $(this).parents('.cart').find('.qty').val(); alert(qty); }); }); </script>

    Categories : Javascript

    Finding dynamic checkbox in jquery , But using only a function?
    For dynamically added controls you will have to delegate the events handler function to the controls. It can be achieved using .on() in jquery Have a look: http://api.jquery.com/on/ For eg: $( '#wrapper' ).on( 'click', 'a', function () { ... }); where wrapper is your static element and a is your dynamic element like : <table id="wrapper"></table>

    Categories : Javascript

    Need a more elegant way of finding an element in the dom tree with jQuery
    I think you want to do this: $(".postmetadata:contains('Vancity Buzz')") .closest('.read') //Closest will get you to the parent with class .read .siblings('.articleImageThumb').hide(); //this will get you all the siblings with class articleImageThumb this refers to window there not the element you are checking in the if condition. Fiddle I don't know if your intention is to have the empty anchor tag just by hiding the image. if so just add a find to it.

    Categories : Javascript

    jQuery not finding inputs in table cells
    $(this).text() will somehow 'remove' the html tags, but it will keep all the characters present as text in your nodes. This will include the white spaces. With your example, the .text() call will return " cell " (space - "cell" - space) or " " (space - space) - as shown in this fiddle. Identifying a cell based on its sole .text() value is a poor choice indeed. Try mithunsatheesh' answer, or try to add some id or class attribute to your cell, and use the appropriate selector. If you gave more context, maybe someone could give you a more appropriate answer.

    Categories : Jquery

    AngularJS Finding all Hidden Input in a scope WITHOUT Jquery
    If you really need to access those hidden fields within your controller (which is not good a practice with angular, as @Ye Liu said above) try angular.element("input[type=hidden]"); It will give you a list with all the hidden inputs. You need to have jquery linked up in your html file before angularjs script.

    Categories : Javascript

    finding a specific td and assign the value to a text input using jquery
    Use the .is() function with the :contains selector (jQuery version added: 1.1.4). $("td",table).each(function(){ if($(this).is(":contains('AD Login')")) console.log($(this).next().text()); }); Notice that .contains() doesn't fit here for it can only check to see if a DOM element is a descendant of another DOM element. (From the API). Regarding what you've written in your comment - it always returns true because you're just concatenating $(this)'s string value to another string (":contains etc."). When converted to boolean type, string immediates are always true.

    Categories : Javascript

    Finding nearest video tags id using jquery of a hidden div
    Your HTML-code is not complete is it? The video-tag is missing ending tag </video>. I assume the divs are siblings to the video-tag, so you could use siblings-selector instead of closest, which travers up the dom-tree. Also if the class vjs-tech is the class of the video-tag, you might not need the find-part. Depents if you have multiple video-tags, in which case you could do var closest_video_id = $(this).siblings("video.vjs-tech").attr("id");

    Categories : Javascript

    jQuery: Finding file size and adding it to the link
    you wrote (twice) json.headers['Content-Length'] when the name of the property (you can see it in the body of the response) is actually in lower case: json.headers['content-length'] if you correct this key, the output is (pdf 101.6 KB) Also note that if both your CV and download page are on the same domain, you could simply use a HEAD ajax request and read the content-length response header

    Categories : Jquery

    jQuery Looping through Array and finding the not selected items
    I don't know if that can be done with jQuery, but I'm a beginner web developer. What I think you could do is to add a "clicked" class to the element clicked, then check all the other elements not with that class and work on them.

    Categories : Jquery

    jQuery.grep usage for finding keywords and phrases
    function isSpam(array, name){ return $.grep(array, function(i) { return name.indexOf(i) >= 0; }).length > 0; } FIDDLE

    Categories : Javascript

    node.js with readFile html but not loading/finding jquery file
    You haven't actually serve the file if the current_url isn't "/", right now your server can only send the file content of index.html to the client. You need to have something like the following in your "else" clause: fs.readFile(file_path, 'utf8', function (errors, contents) { response.end(contents); });

    Categories : Jquery

    Finding nearest HTML fragment identifier to scroll position with jQuery
    i quite don't understand your question, but to do something on scroll using jquery you can try this. $(document).ready(function(){ $(window).scroll(function(){ if ($(window).scrollTop() > 100){ /*you check if identifier has appeared here*/ } }); });

    Categories : Javascript

    jQuery UI Draggable 1.10.3 issue with Firefox not finding cursor center when window is scrolled down
    Ok having searched high and low, I finally found out that this is a bug...due to be fixed in 1.11.x http://bugs.jqueryui.com/ticket/9315

    Categories : Javascript

    JQuery selector for finding a nested span within a nested class is not working
    I don't see any problem with your code at the moment, let's reformat it a bit: var tabs = $('.collapse').not('.in'); console.log("tabs.length: " + tabs.length); tabs.each(function () { var $this = $(this), thisErrors = $this.find('.field-validation-error'), thisId = '#' + $this.attr('id'); console.log("current tab ID: " + thisId); console.log("number of errors: " + thisErrors.length); if (thisErrors.length) { $(thisId).collapse('show'); } }); Or working fiddle: http://jsfiddle.net/Rq8y7/ Does it work now? And what's the debug message in console after you run above code?

    Categories : Jquery

    Finding the last visible li element within overflow:hidden element (jquery)
    You can't directly query for elements that are overflowing as they are not hidden as far as the DOM is concerned (and there are no attribute changes to check for with JQuery). You will need to check positions instead against the width/height of the menu. JSFiddle here: http://jsfiddle.net/TrueBlueAussie/WFGJ4/ menu.find('li').each(function () { totalWidth += $(this).outerWidth(); if (totalWidth > menuWidth) { $(this).before("<li><a>More</a></li>"); return false; // Abort loop } }); I put auto scrolling on the menu so you can actually see what is overflowed.

    Categories : Jquery

    Call code behind method in jquery, not finding the method
    ASP.NET AJAX Page Methods are intended to run inside of .aspx pages and not .ascx user controls. Move your WebMethod logic into an .aspx page and update the AJAX call via jQuery.

    Categories : C#

    PHP or JQuery function for finding a string containing another string
    You should probably do it in javascript and in php (client side and server side). The javascript eqivalent of strpos is indexOf. If you only check with javscript, someone could forge a post packet and it would still be accepted by the server. If you are only going to check in one place, make it server side, but for user-friendly-ness, both is preferred.

    Categories : PHP

    finding the last value different than 0 (without VBA)
    If your dates start at A2 and YTD Actual amounts start at B2 try this formula for C2 copied down =LOOKUP(2,1/(B$2:B2<>0),B$2:B2) that will give you the required results

    Categories : Excel

    C++ Qt Finding every disk in /dev/
    It seems you're confusing globbing (wildcards used in shells etc) and regular expressions. But they are not the same. In regular expressions, * means the preceding item appears zero or more times. As such, disk* matches the strings dis, disk, diskk, diskkk and so on. If you want to check for disk followed by anything (including nothing), you must use disk.* where . means any character so .* means any character appearing zero or more times. This corresponds exactly to the globbing pattern disk*. Depending on your needs, you could also use disk.+ to match for disk followed by any character appearing one or more times (which, compared to disk.*, does not match the string disk itself). I strongly suggest you read the documentation to understand how regular expressions really work.

    Categories : C++

    Finding an average SQL
    I'm going to guess a little bit on what's going on from your comment, so I think your JOIN is off a bit. Try this: Select Company.company_id, company.Company_Name, avg(UserJobRating.Total_Rating) from company inner join jobs on jobs.Company_id = company.company_id inner join UserJobRating on jobs.Job_id = UserJobRating.Job_ID group by company.company_id SQL Fiddle Demo Without seeing your table definitions, this is a bit of a guess, but I would bet you're producing a Cartesian Product with the UserJobRating table with this statement: on Job_id = UserJobRating.Job_ID

    Categories : Mysql

    Finding Power set of a Set
    You can map every element of the power set to a binary number with as much bits as the size of your set. e.g. A = { a, b, c} binary number => resulting subset 000 => { } // no 'a', no 'b', no 'c' 001 => { c} 010 => { b } 011 => { b,c} 100 => {a } 101 => {a, c} 110 => {a,b } 111 => {a,b,c}

    Categories : Java

    Finding Interfaces
    I'm going to take a guess at what you want here. You have a dictionary, something like this: {'L': [(32.992, 22.861, 29.486, 'TYR'), (32.613, 26.653, 29.569, 'VAL'), (30.029, 28.873, 27.872, 'LEU')], 'A': [(1.719, -25.217, 8.694, 'PRO'), (2.934, -21.997, 7.084, 'SER'), (5.35, -19.779, 8.986, 'VAL')], 'H': [(-0.511, 19.577, 27.422, 'GLU'), (2.336, 18.416, 29.649, 'VAL'), (2.65, 19.35, 33.322, 'GLN')]} What you want is something like this pseudocode: for each list in the dictionary's values: for each of the other two lists: for each element in the first list: for each element in the other list: do something with the distance between the two elements. In this case, "each of the other two lists" is pretty simple, because there are only 3…

    Categories : Python

    Finding the value in excel or vba
    You can compare date strings with operators like > or < etc. Concatenate your values in columns A & B, compare to the desired date/time string. In cell C1 put the following formula, and then drag down: ="13-06-2013 12:30"<A1&" "&B1 or more specifically, depending on which "12:30" you want (AM or PM), ="13-06-2013 12:30AM" or ="13-06-2013 12:30PM" Your data in column B may default to AM unless otherwise specified/imported differently, so you may need to tweak the data or to account for this.

    Categories : Excel

    Finding which COLUMN has a max( value per row
    You can use UNPIVOT to get these comparable items, correctly1, into the same column, and then use ROW_NUMBER() to find the highest valued row2: declare @t table (ID char(3) not null,[1] int not null,[2] int not null, [3] int not null,[4] int not null,[5] int not null) insert into @t (ID,[1],[2],[3],[4],[5]) values ('AA1',1,1,1,2,1) ;With Unpivoted as ( select *,ROW_NUMBER() OVER (ORDER BY Value desc) rn from @t t UNPIVOT (Value FOR Col in ([1],[2],[3],[4],[5])) u ) select * from Unpivoted where rn = 1 Result: ID Value Col rn ---- ----------- ------------------------- -------------------- AA1 2 4 1 1 If you have data from the same "domain" appearing in multiple columns in the same table (such that it

    Categories : Sql Server

    Finding Overlaps
    Sorry, my mistake. Forget what I wrote previously. Edited Answer: Sorry untested! SELECT `projectId` , MIN(`timeframeStart`) AS `start` , MAX(`timeframeEnd`) AS `end` FROM `timeframes` WHERE `projectId` != @proposedprojectid GROUP BY `projectId` HAVING @proposedstart <= `projectMinMax`.`end` AND @proposedend >= `projectMinMax`.`start` Yes I know HAVING is evil, but I see now other way.

    Categories : Mysql

    Recursively finding with AWK
    This script will do what you want: $ awk '/nrep=/{printf "%s ",$5}$1=="calc"&&$2=="201:"{print $4, $6}' myfile.dat 19230 1.186 3.985 13456 3.186 1.345 It prints the fifth word of the lines containing "nrep=", (with no newline afterwards), and then prints the fourth and sixth words of the lines having the first word "calc" and the second "201:"

    Categories : Bash

    Finding in a std map using regex
    If the map is small or the search is executed rarely, then just iterate through the map and match each key with the regular expression. Otherwise: If the regular expression is used only for some kind of prefix search, you can use the member function lower_bound to efficiently find all entries with the given prefix. For example the following function first looks for an entry that matches exactly. If no such entry exists, the function returns the range of all entries with a matching prefix. using items = std::map<std::string, item>; auto lookup(const items& items, const std::string& key) -> std::pair<items::const_iterator, items::const_iterator> { auto p = items.lower_bound(key); auto q = items.end(); if (p != q && p->first == key) {

    Categories : C++

    Eclipse not finding gcc?
    It appears to be looking for an executable named "gcc -std=gnu99", which of course doesn't exist. I don't know Eclipse very well, but presumably you have to specify the command name gcc and the argument(s) -std=gnu99 separately. This question discusses setting gcc options in Eclipse. From that and my own brief experiments, compiler options are set for each project. After selecting a project, follow this sequence of menus: Project --> Properties -->C/C++ Build --> Settings --> GCC C compiler In my installation, I have: Command: gcc All options: -O0 -g3 -Wall -c -fmessage-length=0 If you have "-std=gnu99" in the "Command" setting, delete it and add it to the "All options" setting. This is for Eclipse 3.5.2 running on Debian; the menu hierarchy might be different on yours. If that's

    Categories : Eclipse

    can not finding the css,js and images
    You forgot to put echo on several places. I can show you my solution for putting files in header. First I made a folder in the root and named it public, and in that folder I created folders for needed documents (css, img, js...). In constants.php I made this: $root = "http://".$_SERVER['HTTP_HOST']; $root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']); define('ABSOLUTE_PATH', str_replace('system/','', BASEPATH)); define('BASE', $root); define('CSS', BASE . 'public/css/'); define('JS', BASE . 'public/js/'); define('IMG', BASE . 'public/img/'); So in the header you can do this: <link rel="stylesheet" href="<?php echo CSS ?>reset.css"> This is a easy way to maintain and update your files.

    Categories : Codeigniter

    RegExp only finding first value
    Javascript replace() method searches a first string for a specified value and returns a new string where the specified values are replaced. There is no such method replaceAll() exists in javascript. So to achieve this we have to use the regular expressions for searching within the string. The easiest way is, use a regular expression with "g" flag to replace all instances: Try this: px.value.replace(pxVal, pxToEmFixed).replace(/px/g, "em") Converts px to em: function pxToEm(){ var px = document.getElementById("px"), em = document.getElementById("em"), parent = document.getElementById("parent-font-size"); var pxVal = px.value.match(/d+px/g).toString().split(','); var lengthValue = pxVal.length; var pxToEmAnswer; for(var i = 0; i < lengthValue; i++)

    Categories : Javascript

    Finding Covariance using SQL
    Since you have aggregates operating over two different groups, you will need two different queries. The main one groups by dt to get your row values per date. The other query has to perform AVG() and COUNT() aggregates across the whole rowset. To use them both at the same time, you need to JOIN them together. But since there's no actual relation between the two queries, it is a cartesian join on the expression 1 = 1 in the ON. Effectively, that joins every row of the main query with the single row retrieved by the aggregate query. You can then perform the arithmetic in the SELECT list, using values from both: So, building on the query from your earlier question: SELECT indxs.*, ((indx_val2 - indx_val2_avg) * (indx_val1 - indx_val1_avg)) / total_rows AS cv FROM ( SELECT d

    Categories : SQL

    Finding a sensible range
    I ran datag <- data.frame(Probability=rgamma(10000, shape=0.6, rate=4.8, scale=1/4.8)) datag <- subset(datag, Probability<=1) the first one gives a warning which apparently you ignored, but onward: And if these are supposed to be probabilities, the second step shouldn't be needed. But onward You used quantiles; datag is not uniform at all, so you got what you got. If you want to divide datag differently you can use cut. E.g, for 10 classes, evenly spaced: datagcut <- cut(datag$Probability, 10) table(datagcut) but then the first class has many cases and the last very few. You can define your own cuts if you like (see ?cut).

    Categories : R

    RVM Not Finding Library
    Hope this helps link. Install this and tell me what happens

    Categories : Ruby



    © Copyright 2017 w3hello.com Publishing Limited. All rights reserved.