jquery

jQuery check if onClick exists on element

I found the way to check if event exists on element. But it's not work on the events which is not delegated by jQuery... When I try, $("a").data("events"); for this. <a href="#" onClick="alert('Hello, World!')" /> It returned undefined. Is there any way to check if onClick exists on elements with jQuery? Thanks. ...

jQuery - If none of 3 id's have content hide this

Hi All, I have 3 div's drawing content from fields in a database: <div id="one">{data_one}</div> <div id="two">{data_two}</div> <div id="three">{data_three}</div> If none of these three div's have data, can I add some jQuery to hide another div? Thanks, Jack ...

toggling jquery animation getting error

Im trying to have a layer animate/expand hight on click of a "show" button, and then, within the layer, have a button to hide it back to 0. $(".showcart").click( function(){ $("#cart").animate({ height: "400px" }); $(".showcart").toggle();}); $(".hidecart").click(function(){ $("#cart").animate({height: "0px"}); ...

jquery slow apply css class onhover

hello, current situation: i have an <a href=""></a> which has a css background image. in css i have the :hover pseudo class to change the backgroundposition. i would like to fadeIn and fadeOut the two different backgroundimages with jquery i do not have to animate the backgroundposition, but fadeIn and fadeOut two different css class...

JQuery. How to load inputs values to an array?

I have multiple input fields. <input type='text' size='10' name='firstname' id='firstname' /> <input type='text' size='20' name='lastname' id='lastname' /> <input type='password' size='5' name='password' id='password' /> I want to get all their values into a single array with jQuery. Like this one. 1 => 'Barack', 2 => 'Obama', 3 => '...

how to generalize a click function in jquery

I have 13 small pictures and 13 big pictures,if any of the small pictures are clicked it'll show the related big picture, I was just wondering if it was possible to generalize the click function so I don't have to repeat the dame code 13 times, thanks <div id="press_images"> <img id="s1" class="small" src="images/press/...

Print out jQuery object as HTML

Is there a good way of printing out a jQuery object as pure HTML? ex: <img src="example.jpg"> <script> var img = $('img').eq(0); console.log(img.toString()); </script> toString() doesn't work this way. I need the HTML equivalent string , i.e: <img src="example.jpg"> ...

jQuery growing number help

Hay guys, i don't know if there's a plugin for this. But what i want to do is code something which appears to "grow" or "add". So it starts from 0000.00 then grows up to a set value (ie 9000.00) so it goes 0000.00, 0000.01, 0000.02, 0000.03 ... 8999.98,8999.99, 9000.00 Any ideas? ...

Affecting Single Element with jQuery

Hello Everyone. What I'm trying to do is when in my function user will hover over .yell-button then .yell-box-txt will disappear. The only problem is that I have more then one buttons on the site and whenever I'll hover over one of them all text fields are disappearing. this is my function: $('.yell-button').hover(function(){ $...

Cannot populate form with ajax and populate jquery plugin

I'm trying to populate a form with jquery's populate plugin, but using $.ajax The idea is to retrieve data from my database according to the id in the links (ex of link: get_result_edit.php?id=34), reformulate it to json, return it to my page and fill up the form up with the populate plugin. But somehow i cannot get it to work. Any idea...

maintain hover menu on mouseover in jquery

I have a table with some customer data. I am using jquery hover to show the actions(Edit, Delete, View) for the customer. Below is the html: <table id="hovertable" width="100%" cellpadding="0" cellspacing="0"> <tr> <td> Row 1 Column 1 </td> <td> Row 1 Column 2 </td> <t...

Jquery Anchor Elements Moving to New-Line on Hide

Hello, I'm new to JQuery (and JavaScript/AJAX in general) and am encountering a problem with hiding elements. When I use the code below the animation works and the element is hidden but as it is being hidden it is shifted onto a new line along with everything after it. This happens with horizontal hide as well but not with opacity. Is...

Jquery Datatables Fully Modifiable Data Table

Hello all, I'm trying to create a fully modifiable data table with Jquery's Datatable plugin at the moment. By fully modifiable table i mean a user will be able to edit, remove, update, add columns on the table. Based on the examples, currently i am trying the following javascript code: function var_dump(obj) { if(typeof obj =...

How can I detect internet conection in Asp.Net MVC to use Google Maps?

I am developing an Asp.Net MVC application that uses Google maps to show Addresses in a map. The problem is that I need to demo the app in an environment not connected to internet. How can I detect with an script that the app is disconnected not to call the Google maps api functions? ...

AS3 ExternalInterface call using jquery

I'm calling into a flash app embedded in a html page using the ExternalInterface. The following code works fine (I'm using a button to test): $(document).ready(function(){ $("#button").click(function(){ var app = document.getElementById('ApplicationID') console.debug(app) app.pageUnloading() }) }) So th...

When do you choose to load your javascript at the bottom of the page instead of the top?

I have seen JavaScript libraries being loaded at the top and bottom of the page. I would love to know when to make these choices. All the JavaScript code I've written all work at the top of the page, which includes jquery plugins. When do i load my script at any of these positions? ...

JQuery UI + Seaside set-up

Which package(s) do I need to load for jQuery UI in Seaside? Currently I have these installed/loaded: Pharo Seaside One-Click Image Added the jQuery repository to the Monticello Browser (Squeaksource - jQuery) Loaded jQuery-EL.10.mcz However when I run this example I get the error "MessageNotUnderstood: WARenderCanvas>>jQuery" ...

JQuery Clear Form on close

I have the below JQuery Dialog script, I'm trying to find out how to fire off a function that clears the form when I close the dialog. function clearForm() { $(':input','#calcQuery') .not(':button, :submit, :reset, :hidden') .val(''); }; // form popup $(document).ready(function() { //var dataString = $("#calcQuery").serialize(); ...

JQuery problem with html() handling in Opera

Hello everyone. I have following JS code (stripped to minimal size where problem still exists) <html> <head> <script type="text/javascript" src="jquery.js"></script> </head> <body> <div id="debug">this is <em>test</em></div> <script type="text/javascript"> var string1 = $('#debug').html(); var string2 = string1.replace(/<em>/g,...

Jquery - Change dynamic dropdown selected element

I have a dynamically generated Dropdown for which I need to change the selected value using Jquery. <select class="txtfield country" id="ctl00_MainContentAreaPlaceHolder_personalInformation_country" name="ctl00$MainContentAreaPlaceHolder$personalInformation$country"> <option value="FJ">FIDJI</option> <option value="FI">FINLANDE...