load doesn't trigger ajaxSetup complete handler on complete
Hi. I have // Ajax setup $.ajaxSetup({ beforeSend: function() { $('#general-ajax-load ').fadeIn(); }, complete: function() { $('#general-ajax-load ').fadeOut(); } });on page load to set loading animation for all my ajax calls. It works perfect, except for load() calls. For loads only beforeSend is triggered, and complete never gets called, Which results with showing animation which never dissapears. Any idea?
Updating...
Hi, I use jQuery at work (thanks for this wonderful library!!) and now I'm updating to the 1.4.1 release. First problem, this code does not work anymore: var hrefFirstNavLink = $("a.navlink:first").attr("href"); $(".Expander").each(function(){ var hrefVoce = $(this).attr("href").substring(0,$(this).attr("href").lastIndexOf("?")); if (hrefVoce==hrefFirstNavLink) { $(this).parents().children().filter("a[href='#']").prev().click(); $(this).css("font-weight","bold"); }
Is there a way to find an input has focus
I know I can put focus on a an element by $('#foo').focus(). However is it possible to find element $('#foo') has focus?
Using $(this) along with .parent() and .children(' :first-child') issues
Let me first begin with what I am doing. I am trying to build a gallery like script for my website as I type this. Many of you would say why don't you use one of the hundreds of gallery plug-ins for jquery... my answer is this; they dont suffice everything that I want in a gallery and I want to learn Jquery along with it. So now that I have that out of the way let me digg into the problem. What I am trying to achieve is when I click on one of the four thumbnail images, I want it to pass it's alt
How to evaluate Javacript within C#? (need to get all links for a web page, including java-script generated ones)
Hi, I was wondering if a JQuery guru might have a suggestion re my task at hand and whether jQuery can somehow help? Background: I have to download webpages with their resources for offline viewing, however as part of this I have to "rewrite" the URL's for links with the HTML webpage so they work. This is fine more the standard types of links however I'm realizing now that there are some links that are dynamically created by javascript. Question: What approach (or even existing library) could I use
iFrames, jQuery, and loading a background Image
Hello, I am trying to do something that I don't know if it is possible. I have a parent document that has a DIV in the middle of it that loads a picture as background image. On this same page is an iframe that has the thumbnails of the pictures that can be loaded. When you click on a thumbnail in the iframe, the picture loads in the parent DIV as the background. What I want to do is have the parent DIV fade in the pictures when you click on the different thumbnails in the iframe. I am very new to
Looking for a solution
We would like to build a similar navigation to this site Country Road. (vertical slide and horizontal dropdown menu) Which plugin would be most suitable? Thanks!
Update a date input based on first date input + 1year
I have two dates I need to collect in a form. <input type="text" name="EffectiveDate" id="EffectiveDate" /> <input type="text" name="ExpirationDate" id="ExpirationDate" /> Effective Date is entered as mm/dd/yyyy Expiration Date needs to be formatted as mm/dd/yyyy I need ExpirationDate to auto enter to be 1 year more than the Effective Date. I tried the following. $(document).ready(function() { $("#EffectiveDate").change(function () { var d = new Date(); d.setDate(d.getDate()); $("#ExpirationDate").val(formatDate(_date));
$.get request to another server
Hello! Tell me please, can I make a request to another server using the $. Get? I can not: (. Sorry for my English, I am from Belarus:)
noop function return value
hi, wouldn't it be much better if the jquery noop function would return true, instead of nothing? it would be useful if you've optional callbacks which can cancel a process. for example: $.noop = function() { return true; }; var test = { doSomething: function(options) { var options = $.extend({},this.defaults, options); if(!options.myCallback()) { //the callback wants to cancel the process alert('no'); return false; } //the callback says it's ok to continue alert('yes'); }, defaults: { myCallback:
Help converting Element ID to String
God, I'm not even sure if I asked the question correctly... I'm super new to this. Anyway, this is my script... $(document).ready ( function() { $("#stepBox li").hover ( function() { var elid = $(this).attr('id'); loadSWF("/ovi/lib/swfs/"+elid+".swf", "flashBox"); } ); } ); A little bit of background: This is probably a really cheap way of doing what I want, but whatever. Essentially, each <li>
can anyone help please
Hello, jQuery(e).find("a")[ parseInt(data_selected[i]) ? jQuery(this).addClass("selected") : jQuery(this).addClass("") ](); how to write such statment properly it is search for A tag and where data_selected[i] is true addClass data_selected is array of states (010010010101) and "i" is A tag number on the list Thanks
Set a Date based on the value of another date + 1 year
I have 2 inputs: <input type="text" name="EffectiveDate" id="EffectiveDate" /> <input type="text" name="ExpirationDate" id="ExpirationDate" /> Expiration date needs to be set to the value of EffectiveDate + 1 Year. Input is in the format mm/dd/yyyy and required to be as such. I started out with the script below: $(document).ready(function() { $("#EffectiveDate").change(function () { var d = new Date(); d.setDate(d.getDate()); $("#ExpirationDate").val(formatDate(_date)); }); function formatDate(date)
Calculate values from multiple checkboxes and one textbox
Hello I need help with this code. I am beginner. My platform PHP, MySQL. I am not very familiar with Javascript. I need to calculate value of each Checkbox List (Price) plus value from one TextBox (PrixBase) I have found this JQuery which works great in my case, but it make append two numbers instead calcul addition <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> <script language="JavaScript" type="text/javascript"> <!--//--><![CDATA[//>
Get IP from HostName
Hello Everybody! We all know we can use jQuery ajax functionalities to load json formatted data from remote hosts. But... is there a way to know from which IP address that data was loaded? i.e.: let's say my script, hosted in www.myjquery.com, uses jQuery.getJSON() to load a data object from remote host www.remotehost.com. Is there a way to know to what IP address was resolved "www.remotehost.com" to load the data from? Or... is there some other way to be sure the client got to the right server (i.e.
My Function is being called immediately . . . why?
I have the following function in my header: <script type="text/javascript"> function updateWithAlpha() { $("#casestudy").load("alpha.html"); }; </script> The function is called immediately when the page loads. I don't want it called immediately. I only want it to work when a link is clicked. The link works with this function. Though, why is being called when the page loads? thanks
Is there a $.url() function?
Danged if I can find the thread, but I swear I saw a $.url() reference in here a day or two ago. It was being utilized for parsing out the window.location or window.location.search parameters. I made a mental note because that was something I would be needing to do. Now I can't find it, either because the search isn't finding it or I was dreaming about this function existing. Can someone help me out? I rummaged about the API docs and didn't find it there either. Is it something provided by
Jquery doesn't like script filename..
Hello jquery people, I was recently playing around with jquery for my own independent project outside of work, and i found something interesting that was driving me crazy for a bit. I dont know if its the IDE iam using or maybe jquery itself, but i had a script file called include/lookup.js and the scripts i wrote there which seemed perfectly fine to me never would run... so after alot of tedious debugging, I tried just renaming the filename from lookup.js to lookup1.js without changing any of
.load() loading twice after loading original documents then reloading it once more in a different spto
i think this is a problem with jquery. As it doesn't do what i wanted. Essentially what i'm doing is for the first example. I'm goign to load a <div> which is originally hidden, then becomes visible after clicking the link which is intercepted with jquery and it's filled with a fragment of info i selected. Then after that, i have a link within it, what i'm trying to do is to allow the person to click on that link and have it reload that <div> with the information i have set. I'm using the same code
Getting the x1,y1,x2,y2 co-ordinates of an element
Is there a core function that can return the x1,y1,x2,y2 co-ordinates of an element, it seems that this would be a common thing to do. Thanks Justin
double click on first load, why ?
finally I get my Up and Down effect solved with these lines, but I noticed that I have to click the clickable the area twice on the first load, would anyone here tell me why ? here's the code $(document).ready(function() { $("#slideHeader").click( function() { if ($("#openCloseIdentifier").is(":hidden")) { $(".boxgrid").animate({ marginBottom: "-100px" }, {duration: 'slow', easing: 'easeInOutCubic'} ); $('#myToggle').css('background-position', '0 0'); $("#openCloseIdentifier").show();
How to use Lava Lamp and CSS Dock Menu in a website?
Hello, I'd like to use Lava Lamp menu which is a Jquery plug-in. And also I'd like to use CSS Dock Menu which is a Jquery plug-in as well. there are both plug-ins in the below links. css-dock-menu LavaLamp I can't use both of them in a website. For example when I put the Lava lamp .js and .css files in the body tag, the dock menu doesn't work. but when I put the Lava Lamp .js and .css file in the head tag, the dock menu works. but Lava lamp doesn't work. I've uploaded the web page which you can see
Noob question: How to SELECT an item from AJAX response HTML?
hello, i want to select an item from ajax response html. For example. $("#result").load('test.html");Then if the test.html return <div id="abc">test data</div> Is there a way i can use $("#abc").hide(); i try it but it won't work. I think jquery can't see the <div id=abc> element Please help. thanks
Optimizing Tips
Hi All, I was looking today for some tips on good jquery coding practices and speed optimizations. I came across this useful blog post: Improve your jQuery - 25 excellent tips Anyone else recommend any others? Thanks. Ian.
Check Image Loaded : Duplicate?
Hi All, Im checking to see if an image is loaded, before removing a loading div: // see if first image loaded $("#images img:last").one("load",function(){ infoDiv.load(hash + '?type=2', function() { // load text content maskDiv.stop().animate({opacity:0},500, function(){ // remove loading cover maskDiv.removeClass('loading');
$.get request to another server
Hello! Tell me please, can I make a request to another server using the $. Get? I can not: (. Sorry for my English, I am from Belarus:)
Hiding some form elements
Hi I want to show or hide some tags of registration form with changing a combo I wrote this code : $('select[name=user_type]').change(function(){ FormType = $('select[name=user_type]').val(); switch (FormType) { case 'teacher': $('.teacher_form').show(); $('.student_form').hide(); break; default: $('.teacher_form').hide(); $('.student_form').show(); } }) But when the user_type combo changes nothing happens ! This is a piece of my form : <tr> <td> Post </td> <td> <select name="type" > <option value="student"
this vs $(this)
I have merged example code that uses "this" in two ways and I do not understand which is correct and when to use each: $('input[type="text"].requiredText').each(function(){ if (this.value == '' || this.value == 'Required'){ this.value = "Required" $(this).css({'color':'#C0C0C0'}); } $(this).blur(function(){ blnTextHasFocus = false; if (this.value
Delay in execution within ajax SUCCESS call
I am using jquery ajax to load content into a DIV block called "load_content" and i use a DIV block called 'loading_page' to display a loading animation/message. when the ajax part of the code has successfully run its course, the 'loading_page' block should become invisible. the code is below: $('#loading_page').css('display','block'); $.ajax({ type: "POST", url: "load_page.php", data: 'view='+url, dataType: "html", success:
problem with :eq()?
Hi people... Hope some of you get interested in my problem enough to help me find a solution. After a few weeks of reading up on jQuery and Javascript I wanted to apply what I learned to do the following: Hide then display 3 dot images in sequence. i.e. with a 1500 msec delay between each dot I start this on the window load event by calling my function showDotSeq() with an index value of 0 The debug alert statements tell me that I the index is being incremented correctly on successive calls to the
Selecting Immediate children only
Taking the following markup <div id="menu"> <ul> <li><a id="home" href="#">Home</a></li> <li> <a id="about" href="#">About</a> <div> about sub menu </div> </li> <li> <a id="products" href="#">Products</a> <div> <h2>Books</h2> <ul> <li>ColdFusion</li> <li>jQuery</li> <li>CSS</li> <li>HTML</li> <li>Groovy</li> <li>Hibernate</li> </ul> </div> </li> <li> <a id="service" href="#">Service</a> <div> service </div> </li> <li><a id="support" href="#">Support</a></li> <li><a id="contact" href="#">Contact Us</a></li>
Is there a plugin for this?
Looking for a plugin that will display new pages similar to: http://www.nike.com/jumpman23/ - I know that I can shift side to side (A -> B -> C -> D) but I just want to show A -> D nothing in between. Any ideas?
Trouble with JSON
I searched a bit on the forum but the problem remains, maybe it's simple, but I haven't worked with JSON + jQuery before: For example: when I try to do this $.ajax({ url: 'http://isohunt.com/js/json.php?', dataType: 'json', success: function(data) { alert('Worked'); alert(data); } }); data is null, it isn't supposed to be right? how do I actually retrieve the json data from the url?
Sometimes the Load Method can't exhibit some really easy HTML data. Jquery.load bug?
The code is supposed to generate this: PS: This is generated by a PHP Function that the Ajax Load Method Calls. I got this by looking at the source code in the Firefox without using JQuery. <div class="banner_div"> <a style="text-decoration:none;" class="ajax_wrapper_of_subpages" href="empresas.php?id=5"> </a> <a style="text-decoration:none;" class="ajax_wrapper_of_subpages" href="empresas.php?id=2"> <img src="images/banners/19088beb3b6179c9133f4715e3a2ea44.jpg" name="imagem" style="float:left;
Image overlap in slider
Hello, I've built this slider, but I can't get it to line up. The link is http://www.mediaitouch.com/sliders.html Could someone shine some light on this issue? Thank you.
Selecting 1st level children only
Given the following markup <div id="menu"> <ul> <li><a id="home" href="#">Home</a></li> <li> <a id="about" href="#">About</a> <div> about sub menu </div> </li> <li> <a id="products" href="#">Products</a> <div> <h2>Books</h2> <ul> <li>ColdFusion</li> <li>jQuery</li> <li>CSS</li> <li>HTML</li> <li>Groovy</li> <li>Hibernate</li> </ul> </div> </li> <li> <a id="service" href="#">Service</a> <div> service </div> </li> <li><a id="support" href="#">Support</a></li> <li><a id="contact" href="#">Contact Us</a></li>
php page fade transition
I am having trouble with a site. On the site there is a "photo library" pulling from a db. There are 2 views, a thumb view and a large view. On the large view, it also pulls in descriptions etc as well as previous and next buttons. The url looks looks like this. It has 3 categories of pics and the pages are the large pics, previous/next increments the p. /portfolioL.php?c=1&p=11 I am trying to have p=? fade to p=?. There is a main encapsulating div as well. Does anyone have any ideas how how i
[jQuery] Form Plugin - Reference to the form in callbacks
Hi, I needed access to the form that's being submitted in the options.success() function (in order to hide the form after successful submission). I ended up modifying line 222 in jquery.form.js. I added $form as the third argument for all callbacks, like so: options.success = function(data, status) { for (var i=0, max=callbacks.length; i < max; i++) callbacks[i](data, status, $form); // added $form as third argument. }; Is there a better way of accessing the form from the callbacks or would the plugin
Populate inputs from ajax call
Hi all, I'm trying to create a function which sends a ajax call and checks a database for entries. If the number sepcified is found in the data, jquery is to populate some input fields with the result. Example: I looking for 210 and the database found a user with this number, then the ajax returns some information like name, address, postal and city. I created a database call which in a php file created a array with the result: $user[] = array('name' => $row->name,'address' => $row->address,'postal'
Disabling mouseover when onclick event happens, how to?
Hi there, I have this code for animating a vertical menu. It changes the width of a menu item to using .animate(). So the behaviour now is: When my mouse is over the menu item, it expands (width 220px), when I remove my mouse it shrinks back (width 95px). Now I want it to stay expanded when I click on it and shrink back and expand a new menu item when I click it. Menu item are listed, using different css classes for designing their looks. $(document).ready(function(){ $("li").mouseover(function(){
Next Page