jquery

Any PHP -> jQuery libraries out there?

Have any bridge libraries been developed for PHP that provide access to the jQuery framework? Ideally it would be nice to have something fairly extensible so that creating jQuery-based content using PHP code would be fairly easy and customizeable. Does such a thing exist yet? ...

Disable anchors in Chrome/WebKit/Safari

Consider the following code: $("a").attr("disabled", "disabled"); In IE and FF, this will make anchors unclickable, but in WebKit based browsers (Google Chrome and Safari) this does nothing. The nice thing about the disabled attribute is that it is easily removed and does not effect the href and onclick attributes. Do you have any su...

jQuery UI droppables - changing the image that's dropped

I'm working with jQuery UI's droppables and am wondering what the best way to make the dropped clone use a different IMG SRC than the item being dropped. In the photo manager demo there, the thumbnail gets dropped into a slot that's the same size. I'd like to drop a large image into a small slot, and as such I need its clone to use my t...

Valid jQuery on Development fails on Production

I am writing a fairly basic script using jQuery. However, the script behaves differently depending on whether I am running it on my local Web server (localhost) or on a production server. On development, the following code returns the HTML I'm expecting: $('#objID').siblings('.mAddress').html(); On production, the same statement r...

Prevent an element from "capturing" the mouse using jQuery?

I'm trying to resize an embedded object. The issue is that when the mouse hovers over the object, it takes "control" of the mouse, swallowing up movement events. The result being that you can expand the div containing the object, but when you try to shrink it, if the mouse enters the area of the object the resize halts. Currently, I...

Why does everyone like jQuery more than prototype/script.aculo.us or MooTools or whatever?

It seems that jQuery has taken the throne for JavaScript frameworks and I was wondering exactly why. Is there a technical reason for this or is it just that they have evangelists? I have been really happy with using Prototype myself. Should I use jQuery for my next project? ...

Is there a jQuery equivalent of MooTools' Element() constructor?

I am going to be starting a javascript reporting engine for my website, and have started some prototyping using MooTools. I really like being able to do things like this: function showLeagues(leagues) { var leagueList = $("leagues"); leagueList.empty(); for(var i = 0; i<leagues.length; ++i) { var listItem = getLeagueLi...

What is the most efficient way to get the first item from an associative array in JavaScript?

I need to get just the first item (actually, just the first key) off a rather large associative array in JavaScript. Here's how I'm doing it currently (using jQuery): getKey = function (data) { var firstKey; $.each(data, function (key, val) { firstKey = key; return false; }); return firstKey; }; Just gu...

grid controls for ASP.NET MVC ?

If you are using ASP.NET MVC how are you doing grid display? Rolled your own? Got a library from somewhere? These are some of the known grid display solutions I have found for ASP.NET MVC ASP.NET MVC Flexgrid - Has nice column layout method Code based ASP.NET MVC GridView - simple, small, clean MVC Contrib - grid from codePlex jQue...

Refer to a Javascript File in Jquery

I have a simple HTML. I am using the JQuery for AJAX purpose. Now, I want to put my javascript function in a separate javascript file. What is the syntax for this? For example, currently my script section in the HTML is something like this: <script> <script type="text/javascript" src="scripts/scripts.js"></script> <script type="text/ja...

How do I copy the data of an element with jquery?

I need to copy data values from one element to another, but jQuery's clone() method doesn't clone the data. And I can't iterate over the data either: element.data().each because data() is a function and not a jQuery object. It seems I have to keep a separate list of attribute names and reference those but that seems too hacky. So how ...

How do you test if something is hidden in jQuery?

In jQuery, suppose you have an element of some kind that you're hiding and showing, using .hide(), .show() or .toggle(). How do you test to see if that element is currently hidden or visible on the screen? ...

Select all child elements except the first

Say I have the following: <ul> <li>First item</li> <li>Second item</li> <li>Third item</li> </ul> How would I select all the child elements after the first one using jQuery? So I can achieve something like: <ul> <li>First item</li> <li class="something">Second item</li> <li class="something">Third item</li> </ul> ...

IE 7 redirecting after jQuery ajax calls

I have the following code in my file to load a div with HTML from an AJAX call: $('#searchButton').click( function() { $('#inquiry').load('/search.php?pid=' + $('#searchValue').val()); }); This works fine in Firefox and Google Chrome, but whenever I do the search in IE I get redirected back to index.php. I grabbed the URL from Fir...

Filter "list" of divs with Javascript

I have a repeater that outputs divs like the following for every item returned from some method. <div class="editor-area"> <div class="title">the title</div> <div>the description</div> <div class="bottom-bar"> <a href="link">Modify</a> <a href="link2">Delete</a> </div> </div> I need to have a textbox on...

How To change the HREF for a Hyperlink using jQuery

How can you change the href for a hyperlink using jQuery? ...

ASP.NET jQuery error: Unknown Web Method

This is my first time attempting to call an ASP.NET page method from jQuery. I am getting a status 500 error with the responseText message that the web method cannot be found. Here is my jQuery $.ajax call: function callCancelPlan(activePlanId, ntLogin) { var paramList = '{"activePlanId":"' + activePlanId + '","ntLogin":"' + ntLogin...

jQuery: how to change title of document during .ready() ?

I am using some nested layouts in Ruby on Rails, and in one of the layouts i have a need to read in a string from a div and set that as the title of the document. What is correct way (if any) to set the title of the document? <script type="text/javascript"> $(document).ready(function() { // ??? }); </script> ...

jQuery DIV click, with anchors

To make click-able divs, I do: <div class="clickable" url="http://google.com"&gt; blah blah </div> and then $("div.clickable").click( function() { window.location = $(this).attr("url"); }); I don't know if this is the best way, but it works perfectly with me, except for one issue: If the div contains a click-able element, ...

Using javascript and jquery, to populate related select boxes with array structure

Using answers to this question, I have been able to populate a select box based on the selection of another select box. ( I posted my answer here) Pulling the data from an array structure built server-side, stored in a .js file and referenced in the html page. Now I would like to add a third select box. If I had 3 sets of data (model, m...