$("#myul li") vs $("#myul").find("li") - which is faster ?
I've been reading a lot about selector speed and if I understand correctly the claim that Sizzler works from right to left, then $("#myul").find("li") is faster then $("#myul li"), but I have a suspicion that that rule may not be true when leading with an id selector... Could not find authoritative answer anywhere.
Twitter like More button
Hello, Has anyone come accross something like the Twitter More button, i.e. displya results, click 'More' and shows next ten etc... Let me know please. Many thanks,
Ajax Web service Notifications
Hello all. I am not sure if this is possible. I have a asp.net page which calls a Web Service on the button click event via Jquery. The web service calls another class which perform some operations on the database. This class uses events which fire every time a method is executed. The web service, has a method which handle these events and add the event status to a string variable. There is another method on the web service which expose the event to the page. On the page, I have a javascript method
Handling partial postbacks : Alternative to rebinding in endRequest
I am attaching the jQuery Plugin price_format.1.3 to a textbox in my document ready to format the incoming text. On the page I also have a button inside an update panel that causes a partial postback when it is clicked. After the button has been clicked, the price_format plugin stops working unless I rebind it inside of the end request. Here is the code I have inside of my document ready: $("#<%=txtbShares.ClientID%>").priceFormat({ prefix: '', centsSeparator: '.', thousandsSeparator: ',', centsLimit:
Popup and populating the site with Jquery (local access to files)
Hey guys. I have a serious problem. I have a website opening a popup window. Then I populate the new window with content via JQuery. Works perfect. Amongst others I have image tags that are pushed into the new window. Firefox is perfectly able to show these pictures in the popup if I open the site locally. But Internet Explorer is only able to do so when the site is online. The local path to the file seems to be right because if I create a new html file and reference the image the same way Internet
JQuery tooltip
When I use the tooltip in my application,It takes time to load for the first time the page is loaded.The next time it loads normally. 1.Whats the reason behind this. 2.Can it be rectified? 3.If yes.How?
a search question
This is my table structure, I want to find out the index of the tr which first td is empty, in this case, the index should be 1, how to pick it out? <table width="100%" border="1" cellspacing="0" cellpadding="0"> <tr> <td>1</td> <td>1</td> <td>1</td> <td></td> </tr> <tr> <td></td> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td>2</td> <td>1</td> <td>1</td> <td>1</td> </tr> <tr> <td></td> <td>1</td> <td>1</td> <td>1</td>
Problem with click event in JQuery 1.4.2
Recently I downloaded the last version 1.4.2 and tried a new script: function moreLinkHandler() { alert('moreLink triggerred!!!'); }; $('.truncate_text').click(moreLinkHandler); The problem is that on v.1.4.2 every click triggers the event so many times as the number of the remaining elements in the stack of $('.truncate_text'). When I returned the page to the previous version I used (v.1.3.2) - everything was OK. The new script worked as intended. I suppose there is a problem in v.1.4.2, so I
[jQuery] How to avoid throbbing "Hover" actions?
Using either $.fn.hover or $.fn.mouse(over|out), I can't figure out how to prevent my animations from firing repeatedly. You'll see what I mean: http://703designs.com/jQuery/port.php (view source to see what's going on). How would I change this so that the over/hover event can't fire until the element is finished with its current animation? How would I change this so an animation only continues until the mouse leaves rather than taking the full step from 80px h/w to 120px h/w?
Why can't I set variables in $.get()???
$.get(url,function(data) { var stuff=data; },"html"); alert(stuff); Why does this not work? How am I supposed to store grabbed [data] in a variable for later use?
Auto focus on next input field
Hye everybody, I'm trying to make a form with a postal code input. But there are 6 input fields within a div container. When some one types just one letter they automatically go to the next input field this continuing until they reach the last input area. Some one please give me a hint? Thanks anyway
jQuery and IE6
Hello, I'm facing a problem - it could not be a problem - with jQuery 1.4.1 and IE6. When the page id loaded I gave the error "Socket Error: Connection reset by peer". It only occurs on IE6. If I remove or comment the jQuery blocks the error don't appear. Someone had this problem? Thanks
Cannot .remove an .append'ed row
Ok, Way cool how I can add a row by clicking "add". And just as great how I can delete a row by clicking "delete". But why, why, why can I not add a row, and then delete that row? Thank you! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /> <title>Testing</title> <script src="http://code.jquery.com/jquery-latest.js"></script>
jquery.com/Tutorials page not working due to mysql error
Database error From jQuery JavaScript Library Jump to: navigation, search A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was: (SQL query hidden) from within function "MediaWikiBagOStuff::_doquery". MySQL returned error "1205: Lock wait timeout exceeded; try restarting transaction (localhost)".
$.ajax success function help
Hello All, I have a function that I'm trying to retrieve values using $.ajax and push the returned data into an array called output. Problem is the success function will not allow me to push the results into the array. see below for code. var getValues = function(el) { var value = ($(el).val()); if(value == '' || $(el).attr('disabled')) {
Ajax saving sortables in connected lists when sortable item is moved
I have multiple JQuery sortable lists that connect with each other... They allow you to assign users to certain roles. Basically what I want to do is when a user is dragged from one list to another, I want JQuery to pick up the first list that the user was moved from so that I can send an AJAX request to delete it from that list in my database. I tried the following but every time you move the user over a list and haven't even dropped it within a list, it sends this request which means I'll be sending
UI Sortable
Hi everyone, So I'm very new to jQuery, and am working on a Wordpress plugin. Inside my widget I have input boxes where the user inputs some text, and it's displayed on the website in the widget area. There is 6 input boxes. I want the user to be able to 'sort' these 6 input boxes, so they can drag the one box and make it show up before the others and so on.. As you can imagine, there is an options panel for this widget where they should be able to drag and drop to sort the items, but the output
Dynamic Stacking Divs
Hi! This question actually concerns CSS more than JQuery, but I'm using JQuery to do this, so I see this post fit. I have a bunch of rectangular, absolute-positioned divs that I am adding to the body using JQuery. I want them to stack on top of each other, but instead when I add them to the body, they form a column. I tried using css('left', *offset*) but that just adds to it's current position in the column, instead of stopping it from forming a column in the first place. Any ideas on how I would
Autorefresh memory
I am using the jquery library oneTime() function to call a .load() every x seconds. Every time this happens my browser uses up more and more memory. Is there something I can tell load to not cache each instance? AM I going about this wrong?
Activating a specific toggle state?
To make this easier to explain, I'll use a simpler example. Suppose I have a big square that changes color from red to blue and vice-versa when clicked. Now suppose I have several of these squares aligned vertically on the page - each one is able to have it's color toggled independently of the others. Now, what I'm trying to do is have a third option - let's say it's a simple key-press that toggles ALL boxes to be red (or blue, for argument's sake). Basically what I would need to do is somehow be
How to store an object for passing into Animate
I'm trying to clean up my code by re-using objects instead of re-creating them with an object literal every time. Unfortunately, I've discovered that this causes the scripts to halt unexpectedly. Here's an example: $("#CapabilitiesContent").animate({ 'opacity': 0.0, '-ms-filter':'alpha(opacity=0)', 'filter' : 'alpha(opacity=0)'}, { 'duration': cShiftSpeed, 'queue': false }); $("#DesignGuideContent").animate({ 'opacity': 0.0, '-ms-filter':'alpha(opacity=0)', 'filter' : 'alpha(opacity=0)'},
Galleria problem
I'm using the galleria plugin and when you click on the gallery page, the main image box is empty until you click a thumbnail. I would like the first image to appear on load. Can anyone help? Here is the web page. Thanks for helping a newbee. http://www.thepaintedfloor.com/slideshow.html
.children() method does not return jQuery object but Javascript object
<script type="text/javascript" src="javascript/jquery.js"></script> <script> $(function(){ var c = $('#parent').children(); alert(c[0]); // [object HTMLDivElement] this return the Javascript Object and not jQuery Object alert(c[0].attr('id')); // Error : c[0].attr is not a function </script> <span id="parent"> <div id="child">Child</div> </span>Why the Children return Javascript object and not jQuery object ? how to get jQuery object of those children ? Thanks
Fixed-size accordion?
I need an accordion widget that has a fixed size and whose child containers are scrollable in case they're larger than the specified size. I'm new to jQuery and the two examples I looked at stop behaving properly when I assign the "overflow:scroll;" property to the child elements. Thanks! Mike
Drop Down Text with a hover
Hi all. I need help to find jquery code on a hover dropping down text. Sorry its difficult to explain. An example is I want to hover over an image and then text will drop down below it. However I want the images below it to fall as well so the text does not interfere with the image below . Hope that makes sense. I can only find hover drop down menus but that is not what I want. What would I look up? or can any one link me a tutorial or even a website cheers. Ryan
apply overlay script to dynamic content links?
Hello, I have been having some trouble applying an overlay script to <img>'s that are loaded by another script from an external XML file. I was wondering if because the page has to create the elements, the overlay script loaded too quick and couldn't latch onto anything. Also when I manually enter the same <img>'s the script works fine. Does anyone have an idea as to a way to get the overlay to apply to the dynamic <img>'s? thanks very much. Below is the dynamic script and the overlay is using
Any ideas on a memory leak using $.ajax json call?
Hi, I'm trying to chase down a memory leak in my application, it's a page that constantly refreshes data from a json query. In particular the $.ajax call is causing problems. I've pruned it down to a basic page that gets a small amount of json data from an appengine service. When it does 3000 json calls over about 15 minutes memory usage on ie goes from about 18MB to 105MB (ie7 on windows xp). Firefox seems to leak too but not as badly. You can try it out at http://appden.appspot.com/zMockups/jsonMem.html the
[jQuery] server side jquery
Is it possible to run excute jquery on server side. -- Sharique
Autorefresh using oneTime() and Load()
Hello, I am using jquery to accomplish an autorefresh. Everything is working correcly however over time the browser continues to grab more memory every refresh. Am I going about this the wrong way? function gologs(timer) { $(document).oneTime(timer, "logs", function() { updatelogs(); }); } function updatelogs() { $("#listlogs").load("/page.htm", function() { gologs(${refresh} * 1000); }); }
jquery.com hacked?
Just come to jquery, and virtually every page is empty, and those that aren't have random text in them. TO CLARIFY: I mean docs pages as a result of searches. For example: http://docs.jquery.com/Rich_Text_Editor shows 5kjtyjtkrlj http://docs.jquery.com/Text_validation_in_jquery show hai
.style is undefined?
Hi all, In the code below, I get an error "button.style is undefined". When I change the way I get the button element to document.getElementById("button"), I don't get this error. Does anyone know why this is, and if there is some way of making the $("button") method work? The reason I'm asking, is that I am introducing JQuery to a very large project, which uses $("button") method in thousands of places. When I include the jquery scripts, I get this error, but if they are not included I don't
Superfish plugin, close hover menu on click
Hello, I want to alter the behaviour of my superfish implementation so that when an item in any list is clicked, the portion of the menu that is visible disappears. You can see what I mean here: http://pomona.edu/tour/ Currently, the menu stays open which means that potentially a marker you have just opened can be hidden by the current menu. Thanks, Rory
Problem w/ Double Click Event in IE
I have the following code, which displays a letter in the green box when you double-click on it. It works with a function attached to the doubleclick event of OPTION elements. The code works in Firefox and Google Chrome, but I can't get it to work in any version of IE and I don't know why. Any ideas on how to get this to work in IE? Am I doing something wrong? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
Question about a jQuery command in Wordpress archive.php
I am using a Wordpress portfolio theme (Contrast) for a music website and I've come across what I suspect is a relatively easy coding question - easy for someone familiar with jQuery unlike me! In the archive.php the portofolio (a user-selected category) generates a nifty series of bars on the right hand margin with tiel, page meta information, a hyperlink to the post containing details and a thumbnail of the full image. Through an .ajax command, clicking the thumbnail results in replacing the current
AJAX Call + settimeout + JTemplates + .Click
Hallo Guys, I m new to jquery and i asked myself, if it is an bad idea to do something like this? function testIT() { $.ajax ({ type: "POST", url: "....", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { $('#result1').setTemplate($("#TemplateResultsTable").html()); $('#result1').processTemplate(msg); $("tr").click(function()
Add attributes to embed tag?
I have a page with about 5 embedded videos, which look like this: <embed type="application/x-shockwave-flash" width="400" height="225" src="http://vimeo.com/moogaloop.swf?clip_id=4505537&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed>I need to dynamically add the attribute wmode="opaque" to all embed tags. I tried this, but it didn't work: $j('embed').attr('wmode','opaque');I've also
changing the "name" attribute of an item doesn't seem to be working when trying to change it with .attr();
I don't know why but it's not working no matter how much i try to do it. I was planning on posting some elements on a page's div and one of them allows for mutiple things going on at once, as in allows for someone to have more than one of something. And since i don't think that it'll be working right if i try to pull it from 1+ items with the same name it'd just show the last one? Or is it that PHP would show them as a list... either way it's seeming that .attr() doesn't allow for a name change for
Firefox/Twitter code clash
I have created a new theme for Rapidweaver and integrated some neat JQuery animated sliding panels and frankly I was feeling pretty chuffed with my efforts as I am far from a JQuery expert. The site in question is: http://decorate.focusphotos.com/ In the side panel on the left, I have embedded a Titter feed widget, lifting the code direct from Twitter. In Safari, Chrome, Opera and even jolly old IE this works fine. But Firefox has a fit and displays a blank page - or just plain won't load. If I
Firefox issue
link Can someone help me out and take a look at this, i feel like I am loosing my mind here. Yesterday I swear this was all working now it's not. :( Ok, so everything was working in Firefox, now it's not, the crazy thing is, it is working in Safari? I keep getting an error on the first little bit, the $("input[type=text]").focus(function(){ this.select(); });My firebug app says - $("input[type=text]") is null. Which seems like BS. if I delete that line the next function gives
Make an image selection, diplay same image on page in unique id and save to hidden input all in one click.
Hello... Using a UI dialog I'd like to load in 10 or so images. Each would be unique and after you click on one the following needs to happen: 1. Image appears on the parent page in a specified ID. 2. A "hidden" field is updated so that when the user submits the db is updated with their selection. 3. Dialog closes automatically. That's it. Basically it would work similar to "datepicker". I'm using the latest 1.4 and ui and been making great progress as learning basics. I need to do the above and
Next Page