[jQuery] question on using toggle() properly
I am fairly new to jquery and still trying to get my head around some proper implementation. I'm hoping someone can explain why this works: function doToggle(id){ id = '#'+id; $(id).toggle(); } but, this does not: function doToggle(id){ id = '#'+id; $(id).toggle( function(){alert('something');}, function(){alert('something else')} ); } This gets called from: <a href="javascript: void(0);" onclick="javascript: doToggle('some_div_to_toggle');">link</a> Any advice is appreciated.
[jQuery] Disable jQuery Temporarily
For some reason, I can't run a regular JavaScript prototype without a jQuery error saying something like "this.blah" is not a function. So, is there either a way to disable jQuery's trigger handler temporarily or disable jQuery entirely temporarily without removing the jQuery script? Thanks in advance!
[jQuery] Ajax and Rails
I'm totally sure this has been asked and answered 1_000_000 times, but Google has let me down on this one. I'm using a link to trigger an ajax call that create a row in the database. On successful completion, a row in the DOM is appended. Getting around to the question (you knew there was a question in here someplace, right?), I'm trying to return some JSON on success or an array of errors on failure. My failure also sets the HTTP status to "406 Unprocessable Entity". Firebug confirms this is all
[jQuery] possible bug in each()? moving from 1.2.3 to 1.2.6
Hi Im trying to use 1.2.6, moving from 1.2.3. I have a working function in 1.2.3 but it is not working with the updated jquery library, and I'm wondering if i have found a bug. The trouble call is this: jQuery('#apparatus .annotation').each( function(i){............ ....... When stepping over this call, firebug returns an error of "object not defined". As I mentioned, this code is working correctly with jQuery 1.2.3. Note also I'm using jQuery, not $ for all of my calls. Also, im using jQuery.noConflict().
[jQuery] UK salaries
Hi all, Can anyone provide guidance on ranges for salaries in the UK for experienced jQuery / JavaScript / UI programmers? Cheers, -Andrew
[jQuery] Plugin understanding question
Hi, I've come to a situation of making one .js file for many pages. So, some pages have certain divs and some don't. My situation is that whenever a plugin was defined for a certain div in a certain page, I seem to see it being invoked even on pages that don't have that div. For example if page.html has a div called : <div id="page"><div class="a"></div></div> In a .js file I call: $('#page .a').plugin(); (let's say it does alert('hi'); ) But on page2.html, I would see that plugin get invoked anyways,
[jQuery] tablesorter.js default sort
Is it possible to specify that the first click on a new column sorts in descending order rather than ascending? Subsequent clicks would then toggle the order as usual. -- "Any fool can criticize, condemn, and complain -- and most fools do." -- Dale Carnegie Rick Pasotto rick@niof.net http://www.niof.net
[jQuery] Password and Equalto
I have two input boxes: password and password confirmation. The password confirmation has the following validation code: equalTo: "Please enter the same password as above" This works fine as long as the user enters the password first. However, if the reverse happens and the user enters the confirm first, the error message does not disappear when the user correctly completes the password field. I noticed the same thing in the demo on the jquery example for this feature so I am wondering if there is
Wrap contents help
I have a content div where all my content is located. It has <p> and <ul> and images and could possibly have tables. What I would like to do is separate content out in groups and wrap them in a div with a class. So say the total number of children is 30. I would like to wrap the first 30 with a div, then the second thirty and so on. Any help appreciated. Here is my attempt but it doesn't seem to wrap correctly. var num = $('#content > *').not('h3:first').size(); console.log("nodes:
[jQuery] AutoComplete -bassistance
I'm close to getting the autocomplete to finally work...but..... First of all, I'm using Java / .jsp to query a database for results I'm sending the url to my servlet, my servlet passes the data back to the .jsp page....Nothing appears in my dropdown UNLESS I use my mouse, click outside of the textbox and then click back into it. Then the autocomplete works great and displays the data from the database I've tried IE, Opera, Firefox and everyone of them requires me to start typing in the text box,
[jQuery] Nesting Selector
Hello, i got a little problem with using selector, i want to using selector to select a range of element, can i use as following code? $(object:gt(lowerBound-1):lt(upperBound+1)).doFunction(); thx!
[jQuery] Multiple FCKEditor instances & validate plugin problem
Hey all. Im having a hard time getting FCKEdtitor plugin and the "validate" plugin to work along, so please, any advice is very welcome. Im using the fckeditor plugin on all fckeditors, adding the to textareas using the method described here: http://www.fyneworks.com/jquery/FCKEditor/ First I was having that problem where when you try to submit the form, validation returns erros for every required fckeditors even if it actually has text on it. If you try to submit it again, then it works. Is the
[jQuery] jQuery 1.2.X's .clean() mangles namespaced elements
The .clean() method tries to replace empty elements defined as <elem /> with <elem></elem>. Here's the code from .clean(): // Convert html string into DOM nodes if ( typeof elem == "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + "></" + tag + ">"; }); If the element is namespaced like this: <data:person name="john doe" id="123" />
[jQuery] Something equivalent to Prototype's Class.create() ??
Hello all, I've googled this topic... I found one page that was an April Fool's joke but I'm not entirely sure if it's legit or not? http://ejohn.org/blog/classy-query/ Then there's Low Pro at: http://www.danwebb.net/2008/2/3/how-to-use-low-pro-for-jquery So is there a final version that's included in jQuery or does it have to be included separately (i.e. one of the two above - or is there an even better version out there?) Thanks, Shao
[jQuery] jQuery 1.2.X's .clean() mangles namespaced elements
The .clean() method tries to replace empty elements defined as <elem /> with <elem></elem>. Here's the code from .clean(): // Convert html string into DOM nodes if ( typeof elem == "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + "></" + tag + ">"; }); If the element is namespaced like this: <data:person name="john doe" id="123" />
[jQuery] jQuery 1.2.X's .clean() mangles namespaced elements
The .clean() method tries to replace empty elements defined as <elem /> with <elem></elem>. Here's the code from .clean(): // Convert html string into DOM nodes if ( typeof elem == "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? all : front + "></" + tag + ">"; }); If the element is namespaced like this: <data:person name="john doe" id="123" />
[jQuery] remove xml nodes
I have this issue in IE7 where I do an ajax call that returns a XML dataset. I would like to remove certain XML nodes before displaying it into the page. The remove() function works in Firefox but now in IE7. Example: $("award[id='3']",xmldata).remove(); //works in FF but not IE Can someone help me with this?
[jQuery] detemine css properties?
Hi, How (if it's possible) would I determine a specific css property for an element? For example, I have the following code on my page: <style> .information {display:block; background-color: #FFF} </style> <div class="information"> ipsum lorem</div> ------- I'd then like to use jquery to determine the background-color of the element. So that when a button or something is clicked: if the background-color of .information is #FFF, then do X, but if the background-color is #CCC, then do Y. Thanks for
[jQuery] <script> Selector?
Hi everybody, I want to make a script to search in a page for script src='http://* elements on a page for a site full of malicious scripts (added through a bug in the input form of the news system of a restricted area...), so I can make the script remove them on a page load (yeah, why not fix the security hole? because the guy don't want to -_-, well whatever). Anyway, how do I do that? I thought I could do that by using a $ ("script:contains('http://*').remove or something, but I am very naive and
[jQuery] Accordion open when opening a new page
Is there any way to Accordion something open as soon as the page loads? I'd like a <div> group to accordion open when a user has been sent there. Cheers, PH
[jQuery] Using <span> instead of <a> with Superfish
Hi, Thanks to Joel for creating Superfish. It has eliminated many headaches for me. My implimentation is almost complete, but my lack of javascript knowledge is showing (the CSS is tough enough for me). I have a <ul> like so: <ul> <li><span>first category</span> <ul> <li>item 1</li> <li>item 2</li> </ul> </li> <li><a href="/second/">first category</a> <ul> <li>item 1</li> <li>item 2</li> </ul> </li> <li> <a href="/">Home</a> </li> </ul> I would like to automatically put an arrow next to "first category"
[jQuery] How do I find out what the type of the HTML object?
So I got this code: $(document).click(function(e){ var target = $(e.target); }) How do I find out what HTML object (A, SPAN, DIV...) the target var is? Thanks.
[jQuery] jquery and ThickBox question
I'm working on a free project, and having an issue. http://208.101.28.218/?page_id=3 - the Monday link SHOULD be popping up in a 300x300 ThickBox, but it's just popping up in the same page. I've loaded jquery, Lightbox and the CSS, so I'm stumped. Any ideas?
[jQuery] input:empty and remember password
I have a script that displays username and password as background images in the input fields when the field is empty and they removes it when on focus (or when there's content left in the field). I then came up against the issue where if someone's browser populates the input fields after their browser is asked to remember their password and I end up with both the input fields being populated and the background showing. Here's my initial script: $(document).ready(function() { $('#loginArea').addClass('active');
[jQuery] jQuery Coding Standards
Hello I'm looking for "coding standards" for jQuery but find it difficult to find any. Does someone have any suggestions on how our dev-team sould write the code in "best practice", name variables, objects and so on? best regards / johannes -- View this message in context: http://www.nabble.com/jQuery-Coding-Standards-tp19156680s27240p19156680.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Fade() Function not Working on Flash Objects in Firefox
Hello all, I have a page with an iframe inside of a div tag. In the iframe, I have a page with several flash objects. Each of the flash objects is a button that, when clicked, will load another page into the iframe. There is also functionality to show and hide the div containing the iframe. This is where my problem lies. Right now, I am simply calling the fadeIn() and fadeOut() functions on the container div, which is working fine in ie, safari, and opera. However, in Firefox, the Flash objects are
[jQuery] Plugin: Validation: Error message order
Is there a way to dictate order of the error message output when using the Validation plugin (http://docs.jquery.com/Plugins/Validation)? Or to keep the error message listing when put into a single error container in the same order as the form elements appear in the document? I am noticing that the current behavior yields a list of error messages grouped by input type. For example, I have an address form where I have first name, last name, address 1, address 2, city, state, and zip. Let's say that
[jQuery] Multiple Callbacks within an load, post, get or Ajax Call (to get a more detailed progress)
Hi, I am not a native englisch speaker so please excuse my language. I am developing a project which handles a lot of data. Yesterday I thought about a progressbar, which indicates the actual status of an Ajax Call (Progressbar Plugin: e.g. http://www.anthor.net/fr/jquery-progression.html) Now it would be nice to know, if somebody knows how I can tell the progressbar, which status the Ajax call has. For example: A click on a button starts a "load", "post", "get" whatever on a PHP file. $("#button").click(function()
[jQuery] Problem with Tutorials:How jQuery Works
I'm having a problem running the first simple example in this tutorial. here is my code: <html> <head> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("a").click(function(){ alert("Thanks for visiting!"); }); }); </script> </head> <body> <a href="http://jquery.com/">jQuery</a> </body> </html> Seems pretty simple but does not work for me in IE 7, firefox, or Opera. I am running this in IIS on my XP Pro box. IE just gives me
[jQuery] Autocomplete and multidimension data
I have a datastructure looking like this: var customers = [ { name: "A", projects: [{name:"val1",name:"val2",name:"val3"}] }, { name: "B", projects: [{name:"val1",name:"val2",name:"val3,name:"val4,name:"val5"}] }, ..... { name: "XXXX", projects: [{name:"val1",name:"val2"}] }, ]; I use one autocomplete to set the name-values, and in another textbox I'd like to use autocomplete to go through the previously chosen customer to find the projects. formatItem or formatMatch is propably the place
[jQuery] SOT: Documenting keyboard entry for select element
Has anyone seen any good documentation on how the keyboard selection works for the <select /> element in the various browsers. It looks like the behavior is pretty different in each browser. Firefox and IE7 allow variations of doing "ba" to select the first option with a string starting with "ba", however the actual implementation differs (and quite frankly confusing.) IE6 only allows you to toggle through the first letter. So press "b" and then "a" would go to the first option starting with "b"
[jQuery] jQuery Calling Functions
Dear jQuery Group, I am new to jQuery and ran into my first obstacle that I can't solve by Googleing. My code is (I am using a plugin to make my table searchable): $(document).ready(function() { $('table#ratings tbody tr th').quicksearch({ attached: "table#ratings", position: "before", hideElement: 'parent', loaderText:'', stripeRowClass: ['r1'], labelText: 'Search through keywords:', inputText: '', delay:
[jQuery] Autocomplete data lookup from DB
I am trying to populate the autocomplete with list fetched from DB (SQL server 2005), i am using ajax to do this. But, i am facing some problem in which format the list fetch from DB should be passed to the jquery.autocomplete.js By the by i am using Java and Jsp. I have tried to pass as string, arraylist. Can some one please help me.
[jQuery] [autocomplete] making this work with drupal
i'm having problems with remote query for autocomplete. the q is already being used by drupal and it seems that autocomplete's q parameter conflicts with drupal's q parameter being used by menu. Is there a way to change the autocomplete search parameter q to other variable (ex mysearch?searchTerm=foo) any tips on making autocomplete work with drupal will be greatly appreciated thanks and regards
[jQuery] Can't get css png fix plugin to work....
Hi I just tried getting the plugin for jquery it's called cssPNGfix it's supposed to fix the problems with IE for tranparent png files. any suggestions how to get this to work?? I included the jquery main file and also the fix javascript. I don't understand if it needs/depends on any other scripts??
[jQuery] Rename several divs
Hi I've got three div elements with id as following: "foo-1", "foo-2" and "bar-3". And now I want a js function to fetch all divs that have an id that starts with "foo-" and then replace it with "bar-" following with the corresponding number. I've found out how to select all elements whose id starts with "foo-": div[@id^=foo-] But I don't know how I can replace the "foo", and still have the number after -. Hope you understood my question.
[jQuery] Livequery and iFrames
I am trying to track down a problem, and I am wondering if it has to do with iFrames. I use livequery to rebind some the jQuery UI draggable event to a list of links. I have an ajax refresh button, which refreshes the list, and livequery rebinds the draggable events, which works great. But, I have an iFrame on the page which will create a new link within that list. So, after the form is submitted in the iframe, it uses the .ajax() GET method to reload the list of links in the parent window, exactly
[jQuery] [Validate] Use id instead of name when defining rules for jQuery.Validate Plugin
Hi, is it possible to use the id attribute of an input element instead of the name attribute to identify an element when defining a rule, e.g. 'SetLengthRange'? If not, could the code of the plugin be easily modified (by myself)? Where would I have to look?
[jQuery] autocomplete function to fire when no results
I'm using bassistance.de , Jörn Zaefferer's autocomplete plugin and loving it. However I need to be able to call a function or run some javascript code if the inputted text by the user into the autocomplete field returns no results. This would be ideal as an option or a method for the autocomplete object. I've seen a few people ask for this on his site and also here. He mentioned including such functionality in a future release but I don't think he got around to it. Anyone mange to do this or have
[jQuery] Superfish CSS question Position Static
I am having an issue with the menu being extremely slow when I have the following position set to static. .sf-navbar li { background: url('images/menu_tab.png') repeat-x; height: 54px; position: satic; margin: 41px 1px 0 0; padding: 8px 0 0 0; border:1px solid red } It works fine in IE but not Firefox. Any suggestions. Below is the rest of my CSS /*** adding the class sf-navbar in addition to sf-menu creates an all- horizontal nav-bar
Next Page