jquery

jQuery event "looping"

Hi I´m trying to code a tooltip (Yes I know, I have my reasons to avoid plugins in this case) in jQuery. Whe I show the tooltip and leave the mouse in the same place the show and hide repeats forever. It´s like the element triggers the hover event again and again and again. I try unbind for the event but it does not work neither. $("...

call user defined function in jquery

Hi, I am trying to call user defined function in jquery. $(document).ready(function() { $('#btnSun').click(function(){ myFunction(); }); $.fn.myFunction = function() { alert('hi'); } }); I tried following as well function myFunction() { alert('hi'); } but it doesn't seems to work !! Any idea where I am wrong? Regard...

not able to add list item between a list using jquery

Hi I m having a ordered list having the structure <ol> <li> </li> <li> </li> <li> <ol> <li> Test </li> <li> another test </li> <li> <a href='#'>Add </a> </li> ...

Any good lightbox for a modal dialog?

There are thousands of lightbox components and the likes. I've looked at about 10 of them, but couldn't find what I need. Just wondering if anyone know a lightbox like component that: can popup an inline div (that is initially hidden) can be modal (eg. you must select a radio button or you can't close the box) can be called dynamicall...

jQuery: Adding One to Number Inside Element

I'm trying to add one to a number inside a p element with jQuery, but it doesn't work. $(document).ready(function() { function addOne() { var number = $('p').html(); return number++; } $('p').text(addOne()); }); ...

Swap button for image (Jquery)

Hi I have a button and when it's clicked, I want to replace the button with an image. How can I do this in JQuery? Is it possible to replace the background of the image as well? The button itself is within a large div, and I don't want to add another div around the button because it messes up a previous layout. Thanks ...

JQuery response is null but actual response is not

I'm using JQuery to make an Ajax call. I used a sniffer to catch the response text: {"error_code":0,"message":"SUCCESS","data":{"session_token":"3efd9dde-a839-4e91-9415-4c2f6cba5b7b"}} But the response returned on the success callback is null. Anyone got any ideas? (see jquery code below. Jquery code: $.ajax({ type: "GET", u...

jQuery menu active link

Hello, I am trying to make a jquery menu that when I click on one of the links (without reloading the page), it changes its class to "active" and removes this class when I click on another link. here is my code : <script type="text/javascript"> $(document).ready(function() { $(".buttons").children().("a").click(function() { $(".b...

jquery: prepopulating autocomplete fields

I'm using the tokenizing autocomplete plugin for jquery ( http://loopj.com/2009/04/25/jquery-plugin-tokenizing-autocomplete-text-entry ). I mostly use Ruby, and I'm really unfamiliar with javascript, though. My basic setup looks like this, and works fine for a new, blank form: $(document).ready(function () { $("#tag_ids_field").token...

How would this code be refactored to use jQuery?

How would this code be refactored to use jQuery? function emleProcessOnLoad(aThis) { var result = document.evaluate("//span[@class='emleOnLoad']", aThis.document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var jj=0; jj<result.snapshotLength; jj++){ eval("var emleThis=result.snapshotItem(jj);" + result.snapsh...

jQuery UI not binding on popup windows

I get my datepicker control to bind fine to anything with a class of calendarTrigger on any of my pages, however on Popups (Of which use a Master Page and have the script files on it's master page) they don't bind to trigger datepicker UI elements. Is there something I am missing ? jQuery Code Held Within the UserInterfaceScripts.js ...

Create jquery dropdown like RDP Menu Bar

I'm not all that familiar with jquery so I'm not quite sure how to do this. Basically, I want a block of html to stay hidden at the top of the page with a ~3px edge sticking out (something to mouseover), and when you mouse over it, the hidden section slides down. Basically I want it to work like the RDP full screen menu bar works. Any...

jQuery validation: how to customize trigger and response

I am new with jQuery. I have a servlet based application which render an HTML form. This form is submitted via a function and the submit button IS NOT submit button in HTML. It's a regular button that calls a javascript function to do the submission. When running the submission function, the servlet also run a function called doCheck() ...

Format a textbox like "0.00"

Hi How to format a textbox like "0.00" using Jquery or Javascript...If i enter value 59,then it should become 59.00.If i enter value as 59.20,then it should same....How it possible .... ...

How to refresh a inbox when a new message is coming.(Like Gmail)

In my application I have an inbox. If a new message arrives I need to increment the unread count. Do I need to make the database connection for every second to find out if a new message has arrived? Are there any other methods? ...

standard debugging way for javascript/jquery

This is my usual way to debug javascript. Include alert(0); to break the flow and find out what is happening. sometimes when i need multiple check points i do alert('the flow is now in function 1'); alert('the flow is now in function 2'); or sometimes just alert('success'); i would like to know if there is any standard way for de...

remember the highlighted text in html page(add annotation to html page)

Hi, I have an HTML file, i am opening it with webkit,i want to develop an app, such that after opening it, i should be able to select some text and make it highlighted(say by pressing some button 'highlight text' ). And it should remember the highlighted text so that when i open it next time it should highlight the same text automatical...

JSON undefined in IE7

Hey, I am using the following line of JQuery code: $.get('/ajax/buy', {'categoryname':chosenSelected}, function(data) { data = JSON.parse(data); ... However, when running it on IE7 I get error msg "JSON undefined:". How can I use the parser with compatibility to IE7 (and all major browsers)? Thanks in advance, Joel ...

jquery-ui Dialog: Make a button in the dialog the default action (Enter key)

In a jquery modal dialog, is there a way to select a button as the default action (action to execute when the user presses enter)? Example of jquery web site: jquery dialog modal message In the example above the dialog closes when the user presses Esc. I would like the "Ok" button action to be called when the user presses Enter. ...

Is there Google Hosted Version of these jQuery plugins?

Hello Could find the google hosted version of javscripts timeago.js - timeago: a jQuery plugin, version: 0.8.2 jquery.popup-min.js - ColorBox v1.3.6 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 ...