jquery

How to use jQuery .live() with ajax

Currently I am using John Resig's LiveQuery plugin/function - http://ejohn.org/blog/jquery-livesearch/ - to allow users to sort through a long unordered-list of list-items. The code is as follows: $('input#q').liveUpdate('ul#teams').focus(); The issue arises when I use ajaxified tabs to sort the lists. Essentially I use ajax to pull in ...

Transparent PNG animate problem on Internet Explorer

CSS Code: #btn{ background: url(transparent.png) no-repeat; filter: alpha(opacity=0); -moz-opacity: 0; -khtml-opacity: 0; opacity: 0; } JavaScript/jQuery: $("#btn").animate({opacity:1,"margin-left":"-25px"}); I don't have any problem with the code above on Firefox, Chrome and others. But it does not work on any version of...

Regular expression, remove the last specific character in the string with jQuery

I want to continue one task because my head has some problem with a regular expression. How can it be done with a regular expression and jQuery? I have this HTML: <div class="test">&nbsp;&gt;&nbsp;&nbsp;&gt;&nbsp;Presentation Text </div> And I want to get just this text from all this string, every time at the beginning I have " &...

How to pass variable from JavaScript to PHP using jQuery POST

I am passing the variable sessionnum from the following Javascript function in the page chat.php: $(document).ready(function(){ timestamp = 0; updateMsg(); $("form#chatform").submit(function(){ $.post("backend.php",{ message: $("#msg").val(), name: auth...

Tagging searching for previous tags, while allowing for new tags to be accepted

I'm looking for a jQuery plug-in that works the way tagging works on Last.fm. Tagging on Last.fm, uses an autosuggest to find previous tags and recommend them. If you select one of these tags, it updates the CSS like Facebook so it has a bubble around it with an X. Tags are seperated with a comma: , For tags entered that are new and...

Dynamic Padding (jQuery)

$('#menu .sub-right').css( 'paddingLeft', $('#menu .sub-left').width() ); nor $('#menu .sub-right').css({'padding-left': $('#menu .sub-left').width()}); ...these work. What am I doing wrong? Thanks! ...

Set img src based on current URL in Nav with jQuery - similar to hover replace

I'm looking for something similar to this: http://stackoverflow.com/questions/302955/active-navigation-with-jquery-cant-apply-a-default-class-to-anchor But I'm using images inside a unordered list and I want to detect the current URL and append the img src with _over.jpg to show it being the current page. (no lectures on using BG positi...

Disable form using jQuery after submission

Is there any way to disable entire form using jQuery after submission? ...

Can name of CSS ID, Class, JavaScript variables be a copyrighted issue?

If I use any commercial or free/opensource/ CMS's CSS and JavaScript with existing CSS classes, IDs and variable names can it be a copyright issue? ...

jQuery, access div inside a div

<div id="pic"> <div id="left"> <img src="images/left.png" /> </div> <div id="right"> <img src="images/right.png" /> </div> </div> I want to hide the div with id "right" when I click on the div with id "left" Code I am using: $("#left").click(function(){$("#right").hide();}); This is not working, what is the reason? A...

JavaScript dialog box / context menu for text areas

I am working on a project at the moment that requires a dialog box or context menu to display when the text in the box matches a certain regex pattern. For example, if I was to type @user into the text area, a dialog box would show up where the cursor is or just below the typed word containing Ajax generated list of possible matched use...

ScrollIntoView For Table Row Not Working in IE 8

Hi, Can someone please explain why the following does not work in IE8. Basically i'm just trying to scroll a Table Row into view contained within an overflow DIV. Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html> <head> <script language="javascript" src='scrip...

element = $(element); Object expected error?

on a webpage in under developmnt i'm getting this error on IE element = $(element); this code is in prototype.js Object expected How to get rid of this error. Update: jQuery is also being used on site. ...

Select pdf urls with jQuery

Hello, I want to select urls with pdf file extension and list the pdfs separately, using jQuery or PHP. Thanks Jean ...

jQuery add/remove row

I am trying to setup jQuery rows, with add/remove row functionality. I got started with online tutorial, http://jsbin.com/aciba that works fine. It only has input forms though. We need select to choose from. Now, I made some changes to accept selects as as well as inputs: http://jsbin.com/emata This does not work. Try selecting opt...

How can I compare two color values in jQuery/JavaScript?

I get color vlaue with jQuery with .css('color'), and then I know color that it should be. How can I compare colro value that I get from jQuery with for example black color value? ...

jQuery code organization and performance

After doing some research on the subject, I've been experimenting a lot with patterns to organize my jQuery code (Rebecca Murphy did a presentation on this at the jQuery Conference for example). Yesterday I checked the (revealing) module pattern. The outcome looks a bit reminiscent of the YUI syntax I think: //global namespace MyNameSp...

jQuery - replace loop by className

function loadTextboxes() { var textareas = document.getElementsByTagName('textarea'); for(var i=0; i < textareas.length; i++) { if (textareas.item(i).className == "richtextbox") { richtextbox(textareas.item(i)); } } } //window.attachEvent('onload',loadTextboxes); $(document).ready(fu...

Premature form submission with ASP:Panel and jQuery Autocomplete

I have a page with two search boxes, one with jQuery Autocomplete and one plain. To make sure that the correct search query is submitted, I've placed the search boxes in Panels. However, when I select a value from the autocomplete drop-down, the query is immediately submited. Is there a way to override this behaviour, without resorting...

Datepicker doesn't execute when submitted

I have been working on this for days but I don't get it so I decided to ask here. I really have a hard time tracing where is the problem is in my code.. here my code: $(".editME").click(function(){ var element = $(this); var show = element.attr("id"); $.get('index.php',{option:'myReports', task: 'edit', id: show},f...