jquery

jquery- how to detect element value when onclick?

how do i bring the tr value into .click event? i want to be able to pass the tr id into updatedb.php as well- for sql updating enter <head> <script src="jquery-1.3.2.min.js" type="text/javascript"></script> <script src="jquery.jeditable.mini.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(fu...

Postback does not execute the code in jQuery

I have the following script which first shows only the first para of the page to a user. When the user clicks on 'Shw More', the rest of the content is displayed. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <...

Non-blocking Javascript

Hello, I am wondering if it is possible to load javascript in a way in which it does not block the user experience. I am not sure how to achieve the same, but I am looking for a cross-browser solution. I am wondering if someone can guide me in the right direction. Placing the js at the bottom of the page does not work too well. Thank y...

Accessing the currently selected element's content in a html(val) statement in jQuery?

I have a several links whose text content I'd like to replace with a automatically generated image based on the text content. So currently it looks like this: <a href="blabla" class="mLink"> <span class="mText">The Text in Question</span> </a> and I would like to have either <a href="blabla" class="mLink"> <img src="/ImageTextHandle...

SVG draggable using JQuery and Jquery-svg

I have an HTML 5 page where I load an svg circle. When I click on the circle I create another small circle where I click. I want to be able to drag the second circle but cant seem to do it with jquery-ui .draggable(); I am able to move the circle by accessing its cx and cy attributes so there must be a way to drag it. <!DOCTYPE HTM...

How can I submit jQuery form object (not ajax)?

How can I submit jQuery form object (not ajax)? I try form.submit() and it doesn't work. I create the form by tempform = $("<form method='post'></form>"); tempform.attr("action", "abc.aspx"); and then append some form elements into it. tempform.submit(); ...

Proper event handling using jQuery

I've been working with some event handling in Javascript and recently decided to migrate from Prototype to jQuery. I already encountered some trouble using Prototype, but found some workarounds which at least solved the problems, but didn't look very nice to me. Now I'm rewriting everything anyway, I'd like to get it all straight on the ...

jquery parent select - more efficent way

Is there are more efficient way than the following for selecting the third parent? $(draggable).parent().parent().parent().attr('entityid') ...

Select paragraph using jquery

I have a list of <p> inside a <div id="someDiv"> I use this code to hide all in the div except the first one $("#someDiv p:not(:first)").hide(); I want to change the code to do the following: Check if <p> inside <div id="someDiv"> is more than 5. If it is, hide all div except first 4 ones. How to write jQuery? ...

Does jQuery work on the PSP

How well does the jQuery library work on a PSP? ...

jQuery UI DatePicker question

Hi, I have 2 input fields and i am using it with a DatePicker like this $("#depart, #return").datepicker({ showOn: 'both', buttonImage: 'images/icon_calendar.gif', buttonImageOnly: true, numberOfMonths:2, dateFormat: 'dd-mm-yy' }); At some point i want to remove the return field and i am doing it with the .re...

Splitting a floated DIV in 2 if it's going to drop down a row

Say I have a wrapper DIV and, for example, the DIV is 600px wide. Inside this div I left-float a series of content DIVs. These are either 200px or 400px wide, all have the same height. Three 200px-wide DIVs would align perfectly one one line, a single 400px one followed by a 200px one also, etc. Obviously if I had two 200px ones, foll...

Ridiculously simple jQuery reusable function question

Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return false; }); $('a#show2').click(function() { $('.item2').toggle(1000); return false; }); // And it goes on... }); The page the script runs on has any number ...

How to get slideDown to work on a table?

I cannot get the jQuery slideDown function to work on <table> elements. They just appear, without any animation. How can this be resolved? Here is an example... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <...

Applying tags through Regex to spcefic characters of a string given an array with includes the numbers

I'm progamming in javascript/jQuery. Say, I have an array with includes a few number [1, 4, 5] and a string "theword". I want to turn that string into "t<b>h</b>ew<b>or</b>d". What is the best way to do this with RegEx? ...

Firefox, Jquery and missing dom elements

Hi, I've come across a problem when trying to loop through all divs on a page. I can grab all the divs using $('div') in IE but not in firefox. I did the following as a test :- $(function() { var divs = document.getElementsByTagName('div'); alert(divs.length) var divs2 = $('div') alert(divs2.leng...

Quick HTML / JQuery question

How do I check for a click on everything but a certain object? I use (not), but I'm not sure how to call the class / id of the entire page. $(".page").not("#divInfoBox").click(function (event) { } What's the correct way in the HTML code to specify page, as I have something like: <html> <body> <div class="page"> </div> </...

Editing markup of an ASP.NET control then saving on PostBack

I am using jquery to append or remove a <ListItem> (rendered as <option>) from the <ListBox> (rendered as <select multiple="multiple">). The problem arises when I try to save on PostBack. The correct information is saved to the database. However, when the page is loaded on PostBack instead of the new data from the database being loaded...

jQuery UI Sortable and Dialogue

Is it possible to drag jQuery UI Sortable list items between two lists, one of which is in a jQuery UI Dialogue and one which is not? I am trying to create a dialogue where users can drag form fields out of a dialogue into a form which is on the page, but I can't drag the items out of the dialogue border. Thanks in advance Edit It se...

jQuery UI regenerate (zombie) draggable elements

Dear all, I'd like to know how to create draggable elements using jQuery UI that once they are dragged and dropped into another container, regenerate the same item. For example, I can drop a button from container A to container B, and once I do that, the same button (a clone) re-emerges in container A. Thanks in advance. ...