jquery

How to do a jquery ajax call to a subdomain?

Hi there, i could call a page inside the same domain, but its not working when i calling a page in a sub domain due to security issues. what i have to do? help me!!! ...

jQuery .Net Deployment Issue

Just started getting into jQuery and have an issue with a jQuery Post call working perfectly on my local dev box (VS 2008 built-in web server), but failing when I deploy to a windows 2003 server (IIS 6) box. The post works and the page being posted to process things correctly, but a response is never received by the calling Post functio...

jQuery object descendant filtering

Assuming I have a tree structure UL --LI ---INPUT (checkbox) And I want to grab the checked inputs, I would select $('ul li input:checked') However, I want to select the checked inputs of a specific object $myUL that doesn't have an ID. $myUL.children('li input:checked') returns all li's since children filters immediate childre...

How do you check if a selector exists in jQuery?

In Mootools, I'd just run if ($('target')) { ... }. Does if ($('#target')) { ... } in jQuery work the same way? ...

jQuery UI Tabs Get Currently Selected Tab Index

I know this specific question has been asked before, but I am not getting any results using the bind() event on the jQuery UI Tabs plugin. I just need the index of the newly selected tab to perform an action when the tab is clicked. Bind() allows me to hook into the select event, but my usual method of getting the currently selected tab ...

How do I wrap a span around a section of text in javascript?

I have markup like this: <p>one two three four</p> And I want to use javascript to convert it to this: <p>one <span>two three<span> four</p> I have the offset and length of the section I want to wrap in a span, in this case offset = 4 and length = 9. If using jQuery can make it easier, that is preferable. ...

How to get container of draggable inside drop event?

I have an html like this: <div id="container1"> <div class="dragme">drag me</div> </div> <div id="container2"> <div class="dragme">drag me</div> </div> <div id="droponme"></div> $(".dragme").draggable(); $("#droponme").droppable({ accept: ".dragme", drop: function(e, u) { alert( /* find id of the container here*/ ); }; ...

How do I execute JS XHR responses in Dojo?

What I'm looking for looks like this in jQuery: jQuery.ajaxSetup({ 'beforeSend': function(xhr) { xhr.setRequestHeader("Accept", "text/javascript"); } }); ... $("#my_form").submit({ $.post($(this).attr("action", $(this).serialize(), null, "script"); return false; }); Then, when my server returns some Javascript (the Accept-...

How to do an attribute selection for "(this) attribute starting with a #"

Maybe it's the really late night I had but I can't figure this one out. First the html: <div> <a href="#internal">Internal Link</a> <a href="http://external.com"&gt;External Link</a> <a href="#internal2">Internal Link2</a> </div> in order to do something on the page instead of going to the link I need to filter it based on if it conta...

Pluggable edit component in JQuery

I'm developing an editing component (iframe-based) in JQuery. My intention is to make it easy to extend the functionality of the editor through plug-ins. So for example, you might make a plug-in that puts wavy underlines underneath spelling mistakes, or allows images to be inserted, etc. I'm happy to work out the technicalities of this...

Any opensource Javascript editor/javascript eclipse plugin with code assist

I just happened to read jQuery Intellisense Updates from Microsoft and was wondering if there was any editor or eclipse plugin available which provides intellisense complete or code assist. Are there any? ...

Find <a class="button"> elements that do not contain <img>

I have the following markup for buttons (can be changed, but I really don't want to): <a href="#" class="button"> Button text <img src="someimage.png" /> </a> This is styled using CSS to become a rather neat button with an icon on it. I am using jQuery to round the leftmost side of the buttons: $('a.button').corner('tl bl 10px');...

Rebinding events in jQuery after Ajax update (updatepanel)

I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :) I also use Microsofts Ajax framework, utilizing the UpdatePanel. The reason why I do that is that certain elements are created on the page based on ...

Style ancestor element of form input:focus (jQuery)

I have a form with a DIV, 3 INPUTS, each INPUT sits within a LABEL element. I would like to change the background image of the DIV element when focusing on each INPUT. I can't move back up the DOM to fix this with CSS, so could someone suggest a few lines of jQuery please? Thanks ...

jQuery email validation requirements

Hi I'm using the jQuery.Validation plugin for client side validation, and among other things I validate email addresses. Now I also want to validate on the server side (for users without javascript etc). For lack of better ideas I started on a regex, but quite soon I realized that I want to important to use the same requirements as the ...

jQuery Event Keypress: Which key was pressed?

With jQuery, how do I find out which key was pressed when I bind to the keypress event? $('#searchbox input').bind('keypress', function(e) {}); I want to trigger an submit when ENTER is pressed. [Update] Even though I found the (or better: one) answer myself, there seems to be some room for variation ;) Is there a difference betwee...

JQuery tablesorter problem

Hi, I'm having a couple of problems with the JQuery tablesorter plugin. If you click on a column header, it should sort the data by this column, but there are a couple of problems: The rows are not properly sorted (1, 1, 2183, 236) The total row is included in the sort Regarding (2), I can't easily move the total row to a table foot...

Active navigation with jQuery - can't apply a default class to anchor.

I am currently trying to make a navigation-menu where an active-class is applied to the anchors with hrefs that match the current url, so I can style that anchor in a way that makes it stand out from the rest of the menu. This is my mark-up: <div id="sidebar"> <h2>Navigation menu</h2> <h2 class="subnav"><a href="menu1/menu_item1">Men...

Using jQuery .load breaks links to other library resources?

I have a simple html page with a div. I am using jQuery to load the contents of an aspx app into the "content" div. Code looks like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <script type="text/javascript" src="http://code.jquery.co...

IE removes CHECKED attribute during animation

Hello, I have some radio buttons inside a <div> container which I show and hide via jQuery effect. When the container hides in Firefox, the radio buttons are fine and the values reappear when the container reappears. However, in IE, the radio buttons first clear the checked radio button and then hides. You can see it happen in fact. ...