jquery

jQuery .attr() undefined only in Chrome

I'm making an HTML5 tech demo for work in which a user can drag "apps" off a menu onto the screen and they'll appear in moveable and re-sizable iframes on the page. This all works well and good in Firefox, but when I try it in Chrome (Which supports more HTML5 features) it tries to load the url "undefined" in whatever directory I'm in. ...

Find text(A) and replace it with text(B) + HTML

Hello guys, I'd like to find with jquery some specific text, and replace it with a renewed version including some HTML. I've tried this, which is working when I use only text: <script type="text/javascript" > jQuery(document).ready(function(){ jQuery("*").contents().each(function() { if(this.nodeType == 3) this.nodeVa...

js check to see if user has connection

Is there an easy way to check whether or not the user has connection to your website? See if they don't get a connection error. ...

Javascript - filling textboxes with checkbox value

Hello all, In my web application, I've set of checkboxes which on check populate a textbox above them.(If more than one checkbox is selected, then their values appear in the textbox separated by commas). These set of checkboxes appear as rows in my HTML table. Here's my HTML code. <input type="text" id="newContactComment<%=rCount %>"...

Javascript: Detect an image's loading status, and only swap out the old image when the new one is 'loaded'?

i call on a PHP script that generates graph images for me, however, it takes a few seconds. Is there a way to detect when it has finished loading, on the user side, and only swap it with the old image when the php script has finished and the image is ready? here is the Javascript function i use to call the PHP script: EDIT (CODE UPDATE...

Auto generating a new

Ok, so what I am trying to achieve is, when the user clicks on add, it will create a new instance of highway along with mallName and frequency, each of which will have a unique id, eg: highway1, mall1, freq1 : highway2, mall2, freq2 etc etc. But thus far, when I click add, it adds the items, but when I click use the second drop down li...

Is it possible to customize the Please Wait message?

Does anyone know how to customize the $(form).block(); message below? Please help $(document).ready(function() { $('#form1').validate({ rules: { fieldone: { required: true }, fieldtwo: { required: true } }, submitHandler: function(form) { $(form).block(); form.submit(); } }); ...

Adding a new class to the page using jQuery

I am trying to programatically add a DIV with the class of error_icon to the page using jQuery. This is the HTML: <div id="error_icon_holder"></div> When they're added, the markup should resemble: <div id="error_icon_holder"> <div class="error_icon"></div> </div> I tried using .addClass, but that resulted in: <div id="error_ic...

jquery get select options to array

Hi everyone, I'm kind of stuck with one - presumably simple to resolve problem. I want to create the code which will be used for all select elements on the site. Depending on the "label" attribute assigned to the "option" I want to hide all other "div" elements which have classes the same as other "label" values of the "options" in th...

Why does Jquery animation speed up after first run?

I'm making a basic marquee that takes a set of list items and scrolls them (this is for a sports site, they want a news ticker). Everything works except after the first run the duration speeds up. var duration = 10000; var textScroll = function(toScroll, time) { toScroll.animate({left:"-"+toScroll.children().text().length+"px"...

Creating multiple instances of autopopulated select boxes

So here is the deal, I have a form that appears in a table. Each row has a certain amount of information, one of the form elements in a "select" dropdown box. This "select" contains various categories as optgroups and the information under those categories are the options. This is quickly becoming unmanageable as the list gets longer ...

$.getJSON fails with parse error

Hi, I'm trying to use jQuery.getJSON to get data from a domain I don't own myself. I've made it work in the past, but this time it keeps failing. I get the response into the browser, but then Chrome says SyntaxError: Unexpected token : and Firefox says invalid label. There are a few peculiarities with this. Say the code is MY_JSON_RESP...

IE6 only allowing $.get(..) through server

Hello, I am not sure if this issue exists in other browsers; however, if I am simply trying to run a jquery $.get() in IE6, without running through a server, then it[$.get] will fail. As in it wont actually get the file. I am simply trying to grab an xml file in the same directory. I am trying to bundle this stuff up on a disk and distri...

jQuery Load Data into Accordion

Hello, I recently asked a question (and had it answered) here: http://stackoverflow.com/questions/3364937/jquery-load-json I have a follow-up question, I was hoping to receive some advice on. Basically, I am loading data into the following div: "#my_div", which is actually a child element of another div, "#accordion", which is an acc...

jQuery, IE, invalid argument

Hi there! I coded a simple sliding gallery with jQuery. It's a narrow container with a wide table inside that changes it's 'left' property through .animate() Works beautifully on Firefox, Safari and IE8. However i'm having an issue with internet explorer 7 and below. A message error pops up saying 'script error. line: 4619. char: 4. e...

jQuery - How to select the first parent of an element and add a new class "testclass"

Hello all, <li id="ll"> <li id="li_1" > <label class="description" for="element_1">First Name </label> <div> <input id="element_1" name="element_1" class="element text medium" type="text"/> </div> </li> </li> Given element 'element_1', how to select its first parent with tag name as li? T...

small description window on mouse hover on hyperlink

Hi i have a sharepoint custom list and we have 2 columns in there URL and description. i have a list webpart which shows all the URLs from the sharepoint list. But when i mouse hover on the link i would like to show description for that link in a small window. Can anyone please help me implementing this using jquery. Jquery should be a...

ASP.NET an asynchronous WebService ? Is it really asynchronous ?

Hi, I invoke a server side method (by jQuery's $.ajax) which invokes an asynchronous WebService long-running method. The problem is, that while that long-running method is not complete, I can't get the progress of that method for my progress bar. Why server waits until the method completes ? [Solved] ! ThreadPool.QueueUserWorkItem(...

Wrap every 3 divs in a div

Is it possible to use nth-child selectors to wrap 3 divs using .wrapAll. I can't seem to work out the correct equation. so... <div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div> becomes... <div> <div class="new"> <div></div> <div></di...

asp.net mvc 2.0 Jquery form submit

I am using the following code in my MVC application to login a user. If I get back "1", I redirect user to the dashboard view else login is unsuccessful. $.post($("form").attr("action"), $("form").serialize(), function (data) { if (data == "1") ...