jquery

jQuery addClass onClick

The setting is easy; I want to be able to add a class to (in this case) a button when onClick-event is fired. My problem is that I haven't found a way to pass the button itself as the parameter to the function. I'd like to do something like: <asp:Button ID="Button" runat="server" onclick="addClassByClick(this)"/> And then a javaScript...

No luck when trying to use JQuery with CakePHP 1.3

Hi, I'm new to cakePHP but am close to quitting using it due to my inability of getting jQuery to work with it. I'm using cakePHP 1.3 and so thought the Html and Js helpers had made Javascript and Ajax redundant but I can't really find any help/api documentation on how to use Js that is sufficient. All I'm trying to do first of all is...

Jquery: select a child div at its index inside a parent div

If I have: <div id='parent'> <table> <tr> <td> <div id='child1'></div> </td> </tr> <tr> <td> <div id='child2'></div> </td> </tr> </table> </div> I tried: $('#parent> table > tr:eq(1) > div'); I would l...

How do I change the order of several tables based on mouse wheel scrolling in jQuery?

Hi ! I have a div (#thelist) that contains a bunch of html tables. When the mousewheel is turned i want the first table to be removed and added to the bottom. (And the other way around if the wheel is turned in the other direction). For some reason the code below works also from my understanding the list should juts get longer and long...

Is there a jquery clone of ext.js' toolbar?

I'm looking for a jquery equivalent of ext.js' toolbar (http://dev.sencha.com/deploy/dev/examples/menu/menus.html). To be more precisely, my requirements are the following: the toolbar should consist of iconic and textual buttons and dropdown widgets buttons should either trigger actions directly or open submenus buttons and submenus s...

Preferred method for waiting for AJAX in JavaScript

I find myself having to get around waiting for AJAX in jQuery often these days. Problem is, I have to do loops and crap to wait for them. What are some ways that I can wait for the AJAX event to finish before executing code (preferably without making extra functions)? ...

loading a function onclick

Hello. I have the following piece of code <a onclick="$('#result').load('codes/test.html');$('#result').show();" >XHTML code</a> it loads perfectly the content of test.html in the result div and also make it visible. Until this point all are good. When I try to add a function prettyPrint() which apply some modifications on the text an...

jQuery focus() not quite working after first show() in IE

I have a TextBox I want to move the focus to after showing it. The problem is that on the initial show(), it will get focus during the show animation but it's gone after. What's up? It works fine in FireFox, but not IE8. I have a running example here: http://jsfiddle.net/3PDLb/ Also, here is the code: <input id="Button1" type="but...

jQuery - Seperate text into strings

Lets say my HTML looks like this: <p>12345, 23, 64229, 359</p> This paragraph can have hundreds of values seperated by comma. It can also be empty. I wanna make these values into links. The first value should link to "http://www.example.com/?id=12345" The second value to "http://www.example.com/?id=23" ..and so on. What would be the...

paging of datacontrol in jquery dialog

Hi, I'm using Jquery dialogs in my Asp.net web application for all my messages. Now I've tried to fill a listview with customers inside a dialog and its working, but I want to allow the user to use paging in the listview for choosing his customer out of the list. When I press the button to move up 1 page, it ain't working... Maybe it's...

Is there a way to 'search n replace fill' HTML with jQuery?

Dear fellow coders, Just a small question. Say I have the following HTML: <div class="foo"> {text} </div> Now we also have a JS array with 10 entries, all with a key 'text'. I want to use the snippet above as a template (snippet resides in jQuery-able webpage) for the array. Array entry goes in, HTML comes out. Here's the tricky ...

Method for keeping track of "up" and "down" votes

I have a website that picks an entry from a database at random and then displays it to the user. I would like to add a "top rated" page on which the best entries as chosen by an aggregate of user opinions are displayed. I want up votes and down votes as seen here on stackoverflow and on many other websites. I am not very experienced wi...

how to get the location(lat/lng) on google maps v3 from the location(x,y)

i have the (x,y) (event.pageX-$("#map_canvas").offset().left,event.pageY-$("#map_canvas").offset().top) but how to get the (lat,lng) thanks ...

Delete from Database without postback - Want to animate the disappearing item that is deleted

I have a site that show infomation that are contained in div blocks. The info is taken from a database so the user can change the info or delete it. When the user deletes a div block i want to use jQuery to animate that its disappearing and also that its deleted from the database. How can i do this without doing a postback, i dont wan...

getting null while trying to send and receive a form value using json and jquery

Hello all, Here's the HTML part that may be wrong perhaps on the form statement (not sure): <div id='data'></div> <form action=""> <input type="text" name="nomeInput" value="" /> </form> Here's the javascript part: $(document).ready(function(){ $.post("testeBasico_1.php", {nomeInput : $('#nomeInput').val()}, function(resposta)...

Get text from span using jquery

Giving this html, i want to grab "August" from it when i click on it: <span class="ui-datepicker-month">August</span> i tried $(".ui-datepicker-month").live("click", function () { var monthname = $(this).val(); alert(monthname); }); but doesn't seem to be working ...

Check number of list items and columnize if condition exists

Example page: http://vincent-massaro.com/columns/columns.html On this page, there are two ordered lists, one with four items, and one with eight. I need to write a condition that checks how many list items are in each ordered list, and if it's more than four, split them into columns; if there are less than four, don't split into columns...

jQuery frame animation plugin does not work

I am attempting to use the jQuery Frame Animation plugin and cannot get it to work even in the simplest of tests. I have tried to break it down as simply as possible and still cannot seem to get it to work. Here is a test where I'm referencing the files from the demo and I still can't get it to work: <html> <head> <style type="text/c...

Is there any way to use subtitles with mp3s?

I have some .mp3 files of conversations with really bad audio quality that I am displaying on a web page using JavaScript. I was wondering if there was an elegant solution to display these mp3s with subtitles. See the page below for an example: http://bit.ly/ceMihE I came across this jquery plugin which does something similar, but usin...

Do "" and '' have different meanings in JavaScript?

Possible Duplicate: When to Use Double or Single Quotes in JavaScript Hello, Do "" and '' have different meanings in JavaScript? Because I keep seeing those two usages in Jquery, for instance. $("") and $('') Thanks for helping ...