jquery

jQuery closure & object property access

Hi, Can anyone tell me how to get access to variable "a" here: var test = { a: 3, init: function() { $("body").click(function() { alert(a); }); } }; test.init(); This doesn't work either: alert(this.a); Thanks in advance. ...

jQuery REplace Fade Effect with slide up /Slide Down

Can anyone help me to rewrite the below code which use a fade effect , to use a sliding effect.I want Slide up and Slide Down function ShowCostMetrics() { $("#pnlGraph").fadeOut("slow",function() { $("#pnlCostMetrics").fadeIn("slow"); }); } function ShowGraph() { $("#pnlCostMetrics").fadeOut("slow",function() { ...

Everything showed good, except the tabs. (HTML,CSS,JS)

Hello, Iam working on a website and I dont have any clue why the tabs doesnt work when I upload the website. Because when I view the website normal it does work perfectly. By the way: The tabs are working with a jquery script. This is the website URL: http://bmvisuals.poshh.nl/ Greetings. Edit: I mean some of the tabs doesnt appear. ...

Iteration in JQuery

Hi, I am new to jQuery. I am having a variable increment in my code which shows how many divs inn mne of the panel. I want to iterate through those divs to get the properties of the labels, input type ,size everything inside each div. Starting from 1, i want to iterate up to increment .. How can i do so in JQUery? Please give me a su...

Submit a form to Facebox

Is there a way to submit a form to Facebox? As it is right now you need to use an anchor tag to invoke the facebox method but I need to submit a form and send the data to the php handler and show it in facebox. So if I'm on order.html and then submit the add to cart button and the cart is on index.php?action=add (form action) which exc...

How to give a C# handler file as a url to jquery autocomplete

I am creating a custom control in asp.net . In the control itself i have to call the url for getting results for autocomplete. But both .aspx, .ashx file format are not supported by class library. Is there any other format for substituite of the above to redirect inside the class library. ...

JQuery Selector Question

I've got an asp.net control inside a masterpage, so I thought the following selector would get me the selected option for my drop down list, but it's in correct. $("#input[id$='ddlTags'] option:selected") Can anyone shed some light? Thanks. ...

Can somebody explain jQuery queue to me?

I found the jQuery.com document on Queue/dequeue is too simple to understand. Can somebody help to explain it a little in more detail? I appreciate it. ...

How can I pass JavaScript errors from an action to my view?

I have 2 actions, one for GET and the other handles POST requests. Although I have validation on the client side, there are some things I check for on the server-side also (in my action method). In the POST action, when I find errors etc. that I want to report back to the UI, what options do I have to send back messages/errors to the c...

JQuery book recommendation and can we have a books reference wiki on SO?

I started looking at a book for JQuery and as usual I started perusing through reviews on Amazon. So far I'm split between Learning jQuery 1.3 by Chaffer and Swedberg vs. JQuery in Action by Bibeault. Any pros/cons and what other title would you recommend? It seems that the first title needs also a companiion for the UI, like JQuery UI 1...

Is this right? A jQuery bug that erases the data store?!

Fire up your firebug console and try this out. Compare this: $('body').data('x',1); $(thisx).remove(); console.log($('body').data('x')); to this: $('body').data('x',1); $(this.x).remove(); console.log($('body').data('x')); Notice the difference? If thisx is undefined, it will immediatly throw a reference error. If x is an undefin...

What is jQuery(document) vs. $(document)

I don't get what jQuery(document) is here. I thought you always used $(document) see here in his examples: http://sorgalla.com/projects/jcarousel/ ...

remove CSS Link / update paths with jquery/javsscript? (Design time CSS)

Hi there, does anyone know if its possible to remove a css link at run time... Basically i have partial HTM files in a directory so hence if i add a css link (so i can use my design time editor) then this link isn't valid at runtime and i don't need it as my CSS is in another file. I just want to be able to strip it out when i load it ...

jQuery moving MultiSelect values to another MultiSelect

So I have a MultiSelect box with x values which I need the ability to move to another MultiSelect box and vise versa. <select class="boxa" multiple="multiple"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> <select c...

Can eq(index) in JQuery accept an index more than 9?

Does eq(index) in JQuery can accept index more than 9? And if yes, there is any work around? or alternatives? I am asking because i wrote some code using JQuery for scrapping. And when testing on this page: http://www.zappos.com/n/p/p/7498055/c/181710.html with this JQuery selector "HTML BODY CENTER TABLE TBODY TR TD TABLE TBODY TR ...

jquery.post() and php

I'm using $().post and php to change the contents of a <textarea>. The script is succeeding - firebug clearly shows that the text in between the textarea tags has changed, and my little alert fires. The user, however, doesn't see the changes. In Firefox the change doesn't occur at all, and in IE, the textarea updates up to 10 seconds l...

jQuery Html Manipulation Question

I have the following HTML structure being returned from an AJAX request... <th scope="col" style="yada,yada,yada"> <a href="javascript:funcName();" style="yada,yada,yada"> Test<br />Heading</a></th> <th scope="col" style="yada,yada,yada"> <a href="javascript:funcName2();" style="yada,yada,yada"> Test<br />Heading2</a></th> And I want ...

Best way to find out if element is a descendant of another.

Hi folks, i am in the process of implementing JQuery, and taking out Prototype libraries in my codebase, and i am wondering if you could give me the best way to implement this functionality in jQuery. I am familiar with the jQuery ancestor>descendant sntax, but just want to check if an element is a descendant by true of false, like the c...

Selecting created HTML with jQuery

Why doesn't this work? var string = '<b>Hello</b> this is just a <b>test</b>'; console.log($(string).find('b')); I would expect Firebug's console to give me the two <b> elements, but instead I get an empty array. However, if I change it to this: var string = '<b>Hello</b> this is just a <b>test</b>'; console.log($('<div/>').html(str...

Javascript text manipulation

Just starting with js, decided to convert Friendfeed to a fluid app, and as part of that I need to be able to parse some numbers out of a string. How do I complete this function? function numMessages(text) { MAGIC HAPPENS (POSSIBLY THE DARK ART OF THE REGEX) return number; } input would be "Direct Messages (15)" output wou...