Can JQuery solve the issue with my spinner not animating when I use "window.location=xxx"
Hi, I have a requirement after a user goes to page X which takes a while to load, to show a spinner. I have an issue trying to solve this with basic JavaScript (see below). Can JQuery help here? Details of my current problem: It seems when I use "window.location" as a means to redirect to the API when my longer running transaction is does not ensure the animation for the spinner gif I have works. ie. I see the gif ok but it not being animated. Is there another way in Javascript to force the
Selecting cloned elements by id fails every other time
Hi all I've encountered an odd problem and although I worked out a hack to get around it I can't figure out what I did wrong. I used JQuery to clone() a div (id=div_0) that contains other divs, selects, etc. I change the id on the newly cloned parent div and try to access underlying elements by id as shown below. The JQuery selector fails to find a matching element every other time (evens work / odds don't)! I'm no doubt overlooking some basic logic error or there's something subtle in my code
Saving jQuery chain minus a selector
I've checked Google and searched the jQuery forum and didn't see anything. Is there a way to do the following as I'd like to use the same chain multiple times with with different selectors: var chain = .attr('value', 'Search Digital Collections').css('color', '#E0E0E0'); Thanks, Dean
Code not executing more than once after upgrade to jQuery 1.4.2
This is my jQuery Code $j("#hideBtn a").addClass("inactive"); $j("#showBtn a").addClass("active"); $j("#hideBtn a").click(function(){ var hideEditor = $j(this).attr("href"); $j(hideEditor).tinymce().remove(); $j("#showBtn a[href^="+hideEditor+"]").removeClass("active"); $j("#hideBtn a[href^="+hideEditor+"]").removeClass("inactive"); $j("#showBtn a[href^="+hideEditor+"]").addClass("inactive"); $j("#hideBtn a[href^="+hideEditor+"]").addClass("active");
Beginner Question
What I'm looking for is how to access what object I'm binding too. I'm not sure how to explain the question without presenting a code example. For example, on the autocomplete code below, the extraParams I might wish to set dynamically based on hidden input fields. So the function getSearchParams() would than search all the siblings of the .auto (which would be hidden input fields). Where the .auto is applied to a input text box in a form. This quick line works, until you have more than one .auto
dangling combinator
I'm trying to track down why jQuery is writing a warning message to the Firebug console that says "Unknown pseudo-class or pseudo-element 'selected'. Dangling combinator." I only use the selected pseudo-class in one place in my code. Here's the line: var option = $('#' + selectId + ' > option:selected'); The purpose of this line is to get the option that is currently selected in a given select element. I've added my own logging around that line and it seems that the "dangling combinator" message
Closing a tab - Customization
here is my code, next tab (if available) should get activated if I close the current tab.I could do that but strange, the previous tabcontent is still displaying. Really annoying. could some body help me? Here is my full page html. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title>
how to determine which tab from post im in.. need to perform actions based on tab
Im using flexigrid, and tabs (comes with jquery). I have it set, so each tab does a different url: post. Is there something i can use in the jscript to determine which tab Im currently on? [code] else if (com=='Add') { <? if (!$_GET['tid']) { ?>alert('You cannot add a customer in "All Towers" View, please select a tower and try again.'); <? } else { ?> alert('Add New Item Action'); <? } ?> } [/code] Or is there another way
accessing last cell in current row
Hi! i'm trying to remove last cell in each of my table rows, but i don't how to use :last selector with $(this). here is the code: $('#myTable TR').each(function() { $(this).find(td:last).remove(); } thanks in advance!
the delay() function
Hello, This function allow to stop animation of selected object but only animation, not manipulation. ex : $('#my_id').fadeOut().delay(500).fadeIn();No problem :), but $('#my_id').fadeOut().delay(500).text('hello').fadeIn();function text() is immediately called. Is there a function as delay() wich really "stop" code for a while ? Thanks, and excuse my english I'm french.
Gif animation in joomla menu?!
Hi all, I am building a website using joomla and wanted to put a small aanimated giff into the menu. The news tab to be precice. What menu system should i use in order to do this as easily as possible? Any ideas would be greatly apreciated! I may have posted in the wrong forum, if so can you point me in the right direction?!
Beginner Question About Toggling Values
OK, I've used JavaScript at different times on different levels, and I can get it to do most anything I need. I've never used JQuery,and I'd like to get started with it. I see a toggle function, and I'd like to use it, but what I see is toggleClass. What I need to do is even simpler. I'd like to toggle an id. I'm going to have pairs of two tags like this <img class="inactive" src="img.png" /> <input type="hidden" id="12345" name="12345" value="inactive" /> When someone clicks on the image, I would
Dynamic radio buttons cannot be changed (IE)
Hi All, I've found a very weird issue with my form. I'm dynamically generating radio buttons, but in Internet Explorer (tested in versions 7 & 6), you cannot change the radio buttons after they've been added. In Firefox (testing in 3.6) it's fine. I've mocked up some code below which shows the issue. It generated up to 10 radio buttons (by random number) and checks that radio button programmatically. However you cannot manually select an already generated radio button. HTML: <form action="list.htm">
$j('div.testing').load('index.php div.dataDiv' .... ) is not working in Safari
Hi all, I would like to get data in one div from other page in same domain into one div: <div class="testing"> </div> <script type="text/javascript"> $j('div.testing').load('index.php div.dataDiv', {option: 'com_npriders', view: 'detail', id: '17', country_id: '35', Itemid: '53'}); </script> In IE and FF is okay, but Safari and Chrome is failed. If I run the following codes which is without "div.dataDiv" in load method, it is successful in Safari and Chrome too: <div class="testing">
help needed jquery with icefaces
hi, i need to get the value of the element form ice:inputText which icefaces component. i know the below way to get the value of pain html input box. var min= parseInt(jQuery("#input1").val()); but this is not working with the ice:inputText which is in ice:form. is there anything special way to use icefaces access icefaces components? plesae let me know. Thanks in advance. saran
<select multiple="multiple">, change() and ie6
Hi. I have found a problem with <select multiple="multiple"> and .change() under ie6. The problem is ie6 fires first change event right after any other event, like selecting again, clicking mouse, pressing a key etc. It is perfectly seen on http://api.jquery.com/change/. Just click any option in demo, nothing will happen. If i put a handler using plain DOM, i.e. $("select").get(0).onchange = function() { ... } the problem dissapears. So, it's definitely a bug with jquery. JQuery version 1.4.2.
I need help for JQuery problem
Good day, I have script for moving background: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>" type="text/javascript"></script> <script type="text/javascript"> var scrollSpeed = 1; // Speed in milliseconds var step = 1; // How many pixels to move per step var current = 1; // The current pixel row var imageWidth = 3000; // Background image width var
dynamic load while scrolling
hello, im using this tutorial on loading mysql data while scrolling a page, however i need to complicate it a bit more to support my system. http://www.9lessons.info/2009/07/loa...query-php.html basically the php script above only gets normal queries by id number of the last row, however my queries are dynamic and when ever they are run they return a different set of numbers. for example 5,8,14,20,43... vs 1,2,3,4,5... is there a way to rewrite the jquery function to get a specific list of queries?
Is jQuery really for “Enterprise”?
In the recent new release celebrations it was stressed that jQuery is for enterprise! I tested jQuery AJAX utilities with Java Servlet’s new asynchronous support (which gives a way to emerging popular “Server Push” technology), but the jQuery AJAX utilities are not capable of keeping on receiving many responses (from the Servlet) asynchronously over time for a single AJAX request. If jQuery cannot support server push, you cannot claim it for enterprise! Is jQuery really for enterprise? Can
get .text() of an element, excluding text nodes of decendants which don't match a selector
I want to get the .text() of an element, excluding text nodes of descendants which don't match a selector, e.g. ":not(h2, h2 *, h3, h3 *)" e.g. from the following example tree I want to get the string, "aaacccdddeee" <div> aaa <h3> bbb </h3> ccc <div> ddd </div> eee </div> The following doesn't work, $(':not(h2, h2 *, h3, h3 *)', context).text() - because for each matched element, it returns all descendant text nodes, so it returns some text nodes multiple times - "aaabbbcccdddeeeddd"
Target top LI level individually
Hi Guys, Am having a fiddle with the following for a while now and am not getting anywhere - also not knowing if what i am trying is actually the best / fastest way... What i have is the following menu -------------------------------- <ul> <li>Test</li> <li>Test <ul> <li>Test</li> <li>Test</li> <li>Test</li> </ul> </li> <li>Test</li> <li>Test</li> </ul> -------------------------------- In the head i have 'tried' the following -------------------------------- <script
.live Hover w/Prepend and Remove NOT Removing
Looking for some assistance with using hover on externally loaded content. I have a web page with a DIV that I LOAD with an external webpage. The external webpage once loaded has a DIV that when hovered over PREPENDs items to the DIV . This part seems to be working. When the DIV is no longer hovered over the prepended items should be removed, but alas they are not. Please take a look at the following and point out my error. <script type="text/javascript"> //ADD THINGS $("#apDiv10").live('hover',
getJSON, URL, PHP responses?
I am not quite certain I am doing this correctly however from everything I have read/researched from the jquery howto's, forums and example pages my code should work correctly. First I am attempting to load a json response generated from a php file on another server using the jquery.getJSON function. <script> $("#permissions").click(function() { $.getJSON({ dataType: 'json', url: "http://server/file.php?callback=?", data: ({ token: "12345", resource: "abcde" }), success: function(XMLHttpRequest,textStatus,
Is my code hacky? If so, I'd love some help
I am creating a grid of thumbnails. When a user hovers over a thumbnail, the image enlarges. The *trick* is, I want the "active area" to only be the size of the thumbnail. That is, the thumbnails are 180x120, and when the mouse leaves that area, I want the large image to shrink back to normal size. I have a working demo here: http://www.norabrowndesign.com/testLayouts/expanding-photos-li.html The way I accomplished this feels hacky though, and I's like to know if there's a simpler/more elegant way
what is the difference between append() and insertAfter()
I want to give functinality to add and remove rows dynamically using jQuery. if i add a row in table using "append()" and try to access newly added row,( with last() or slice() ) then it references the the last row before new rows inserted dynamically. Instead if i use insertAfter(), i can reference the new rows correctly. what can be the issue? Works wrongly: $("#tbl2 > tbody > tr").last().append('<tr"><td>1</td><td>2</td><td>3</td></tr>'); $("#tbl2 > tbody > tr").last().remove(); Works as desired
Having trouble using KeyUp();
Hey there everyone. I'm having some trouble using the KeyUp() API. What I'm trying to do basically, is have an event trigger after a specific word is typed into an input field on a page. Everyone so far has told me to use keyup to catch the specific text, and then execute a command. The only problem is, I'm having a hard time figuring it out! Would anyone mind explaining to me how I might be able to do this? I'm not looking specifically just for the code, I'd really like the code, but I'd also like
Anyone know how to refresh/reload page on browser resize
Hi, I need to some how reload the page when a user re sizes their browser. I'm using jquery. I'm able to reload the page on click and i can peform a function on resize, but for some reason the reload bit doesn't work when in the function that firs on resize. What i have so far: This works on click Code: $('#target').click(function() { window.location.reload(true); }); and this fires the resizeWindow function ok but the window.location.reload(true); is ignored $(window).bind("resize", resizeWindow);
acessing form elements by name
I can access a form using $(this).closest("form") what do I do to access one of the form's hidden element by name? $('input[@name=foo]') does not work for this purpose because there may be more than 1 foo. I need the foo of that particular form.
[jQuery] ANNOUNCE: Truncate plugin v.2.3 -- now preserves HTML
This has been a long time coming, and is a major update for the plugin. Previously, if you decided to truncate a string, it would strip all the HTML from that string. Essentially, it worked by slicing the string in two, and by hiding the second half. The new version uses a series of regular expressions, and maintains two copies of the string. I won't go into all the technical details, but I threw some pretty nasty HTML at it, and it seemed to work well. Empty HTML tags after the truncate will be
multiple document ready(s) and noconflict
I'm having trouble using jquery with Rails. I know there are a few plug-in solutions but I am more designer than developer and the rest of my team isn't excited about changing to a new plug-in midstream. I want to be able to write my jquery and be able to have the least impact on existing code. This means that I have to use the noconflict method. Originally I was trying to use Rails to write all my jQuery into one document ready statement but I recently found out you can have more than one. doh!
need help isolating specific input field selector
I'm trying to update the input field that ends in the word 'label', but not update the one that ends in 'label' and has 'choice' in the name. (really just looking for line 9 to work) <html> <head> <script src="js\jquery-1.3.2.min.js" language="javascript" id="javascript"></script> <script> $(function(){ $(':input[name$=label]').val('111'); $(':input[name*=choices]').val('222'); $(':input[name$=label]').find(':input[name*=choices]').val('333'); $(':input[name$=label]').find(':not:input[name*=choices]').val('444');
how to stop firing change event when page loaded
here's my code. when you load the page, alert shows up. is there a way to stop that? i only want alert to show when I change the selected item from dropdown list. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ $("#s1").change(function () { alert("sdfsdfsdf"); })
Inject CSS Class or ID into body tag
I'm sure this is a fairly simple task using jQuery but I couldn't figure it out. I'd like to inject a CSS class or id into the body tag of a specific page upon load. I'm using Squarespace which is a web-based CMS and their forgot password page does not have an ID assigned to the body tag. How could I accomplish this? Any help would be appreciated. Thanks, Grant Novey http://www.unifycrush.com
Change child window position on its parent window with JQuery
Hello, first of all, I apologize for my bad English. I am a beginner with jquery and do not know their characteristics. My problem: I have a web page (made with asp.net) and from there, I open a child window. I need this child window opens on the left side and bottom of its parent window. How can I do this with JQuery? A greeting and thanks
jQuery brakes periodically_call_remote in Rails ?
I've got a piece of code : /views/measurements/index.html.erb <b>Status:</b><div name="status" id="status"></div> <%= periodically_call_remote(:update => "status", :frequency => 5, :url => { :action => :last_measurement } ) %> /controller/measurements_controller.rb def last_measurement @measurement = Measurement.find(:last) render :partial => 'last_measurement' end /views/_last_measurement.html.erb <%= @measurement.time %> ; <%= @measurement.data %> It works nicely until I add <%= javascript_include_tag
ajax error string
Hi Folks, If I use an error handler in a $.ajax() call, I output the second and the third paramter from the callback. That is "textStatus" and "errorThrown". Now, if for instance my server script throws an error, I typically receive an "Internal Server Error" page. In that case, "textStatus" is just "error" and "errorThrown" is "undefined". My question here is, can I access the whole error string in the jQuery error event handler?
jQuery load Google Visualization API with AJAX
Hello. There is an issue that I cannot solve, I've been looking a lot in the internet but found nothing. I have this JavaScript that is used to do an Ajax request by PHP. When the request is done, it calls a function that uses the Google Visualization API to draw an annotatedtimeline to present the data. The script works great without AJAX, if I do everything inline it works great, but when I try to do it with AJAX it doesn't work!!! The error that I get is in the declaration of the "data" DataTable,
$.getJSON SSL & IE
Hello dear friends Please try to resolve my issue (its happen only with IE): location is : https://example1.com current location protocol is : HTTPS When I try to run code (something like this) : $.getJSON('http://example2.com', function(sid){ ... }); in IE (6-8) I will recieve ssl warning message about unsecured receiving data HELP PLEASE!
post processing html returned from an ajax call
i'm dynamically filling a div with an ajax call like so : $j.ajax({ 'async':false, 'url':'<?php bloginfo(template_directory); ?>/work-ajax.php', 'success':function (data) { // alert(data); $j('#work-container').html(data); }, 'complete':function () { workloaded(); }
Ajax, XML and 301/302 responses
Hi, I'm having a problem to follow redirects on 301/302 when the type is "xml". From what I've understood, the browser doesn't follow redirects (at least Firefox 3.6), and jQuery's ajax function doesn't follow them either. So I have to do it myself, and I'm trying to do so by using adding a complete() method to the options of my Ajax query. The problem is that in the case of a 301/302, the response is empty. That causes an error (parseerror) because empty is not valid XML, and instead of getting
Next Page