Multiple AJAX requests are not calling onSuccess until all requests are done.
Ok, so I'm working on a little photo gallery that will load a set of images using AJAX. Basically it will load a 'loading.gif' placeholder image, make an AJAX request to generate the thumbnail image. PHP page generates the thumbnail and sends a confirmation that the image has been generated and the path of it. My onSuccess should then replace the loading.gif with the actual thumbnail. The problem: This all works just fine, except it won't start putting the thumbnail images in until after ALL the
$.post() ie 8
$.post() is running perfect for the first time in internet exploer 8 then it start error object does't support this property or method... code running perfectly in all other browsers. Thanks in advance.
help to close a popup after time out
Could someone point me any jquery function or plugin to control popups? I need to close a login form (popup) if the user forget it opened (after timeout without user activity) That is what I tried: (javascript only) var popup , last_history = 0 ; function open_my_popup(url) { popup = window.open(url, 'my_popup', ''); setTimeout("clock()", 5000); } function clock(){ if( popup.history.length; > last_history ){ last_history = popup.history.length; setTimeout("clock()", 10000); }
How can a trigger 2 events with 1 action
I have a list of 3 paragraphs in my document I set them all to hide - and provide a link to (show) each of them I need to make it so that the {click} of a link shows the corresponding paragraph AND hides the other paragraphs. This is my code: {Head} <script type="text/javascript"> $(document).ready(function(){ //Hide all 3 paragraphs $('#First').hide(); $('#Second').hide(); $('#Third').hide(); $('#Firstx').click(function() { $('#First').fadeIn(1000)("newclass"); $('#Second').fadeOut(100)("newclass");
Data added to element available in one place, but not another
I have a jQuery plugin that creates a list of news items and appends the <ul> to the element(s) calling the plugin. Each <li> gets a document key added to its data. A brief snippet of the code: (function ($) { $.fn.NewsList = function (options) { var defaults = { ticker: '', onComplete: function () { } } var options = $.extend(defaults, options); var elements = $(this); elements.showLoading(); var newsWrapper = $('<ul/>').addClass('list-content headlineNewsList'); $.ajax({
Days between dates
Hi, From a previous question on the forum regarding the number of days between dates the following code was provided. var first = '21/04/2009'; var second = '25/04/2009'; var days = parseInt(second.substring(0,2)) - parseInt(first.substring(0,2)); I have text boxes for "from", "to" and "days". I need help to show how I use the above to display the days. Joe
Form Validation with Drupal Twist
I will try to explain this as simply as possible. We use a 3rd party email marketing tool. We use it to create website forms to collect information from perspective clients. This for relays its data back to the 3rd party marketing tool online. We pas the forms into our drupal pages through the wysiwyg. We then set up jquery form validation. The 3rd party company recently switched there code. Now I can not get validation to work on the new code. Here is the old form code that worked with the form
can I make .change work on dropdownlist before leaving the dropdownbox?
$("#ddlPrimaryCarePractice").change(function(){ if($("ddlPrimaryCarePractice :selected").text()=="Other") { $("#txtPCP").removeAttr('disabled'); } else { $("#txtPCP").attr('disabled', true); } }); The above function seems to work just fine when the user clicks through the form and fires the event like I would expect. However, if the user is hitting the arrow
how to click()
OK... I have this method that takes care of clicking an anchor. First, here are some things that might need to be clicked: <a href="javascript:__doPostBack('btnAddNew','')">Add New</a> <a href="javascript:void(0)" class="SetItemInfo">Some Stuff</a> <a href="javascript:__doPostBack('btnDelete','')" onclick="return Confirm('You want to Delete?')">Delete</a> <a href="SomeOtherPage.html" target="_blank">Get out of here</a> Now, let's assume that we add click handlers to
beginner's problem with IE
I'm using the code below to created tabbed and timed div content. All works fine in Firefox but in IE8 the content divs just display one under the other. In IE6 the tabbed content doesn't show at all, but I'm thinking of not developing for IE6 anymore so not too worried about that, although it would be good to get it to work in all browsers. I am a beginner, so not sure what the issues might be.... and no idea how to fix!! any help would be much appreciated. <script type="application/x-javascript"
Please help me! I'm trying to change the colour of the letters.
I'm trying to change the colour of the letters that have a link. Anyway it is not working correctly on Jquery. Please go over in place of me. //Jquery $("a").mouseover(function(){$().html(<a href="http://www.google.co.jp/"><font size="7">linktest</font></a> )}) //html <a href="http://www.google.co.jp/">リンクテスト</a> I can't have a change anyway on the lines as above.
jQuery Gallery View
Hello, I am using the following script for my shop: http://spaceforaname.com/galleryview Prestashop has a lack of good free modules (with back end admin) and so I start meddling with that module to make it look like this: http://prestoquartz.hostingpower.nl/media.php (The pictures slide show) My JavaScript knowledge is minimal-medium, I mainly used logic, combined with manyyy hours and hardcore attention to make it look and behave like that. As you can see, apparently all the pictures are doubled.
Need fade in to appear faster and alert to appear after one hour elapses
Hi the following code, works ok, but my alert box comes in really slowly, then bounces. I want it to appear faster and to also appear after exactly one hour. I don't think that works right either. What do I need to change in order to do this? [code] <script type="text/javascript"> <!--//---------------------------------+ // Developed by Roshan Bhattarai // Visit http://roshanbh.com.np for this script and more. // This notice MUST stay intact for legal use // --------------------------------->
.load() function does not work on chrome
i tried a lot to load an external html into a div using .load() in chrome (it works in ff, ee, safary and opera). interesting point is online examples are working fine. but when i download the codes, chrome can not load external data on my machine! any idea? here is my load function: $(function() { $.build = {}; $.extend($.build , { setup: function() { $("#content").load("external.html",function() {alert('loaded');}); } }); $.build.setup(); }); Reza Owliaei
change class demo script
I have a script (thanks to brian.jquery12) which changes the class on my body, which changes the bgrd colour of my page. This imitates the changes seen during the day in the real sky. I would now like a script which speeds up the whole process for demo purposes when a button/link is clicked. The class change occurs at the following times of day 0, 7, 12, 15 & 18. I am not sure where to start with this. Any tips or links to other posts. I have searched but not found what I need. The page I am working
add/remove classes to 100 span tags (one at at time) using a single button
For the HTML I have <span id="one">Vestibulum </span> <span id="two">tortor</span> <span id="three">quam,</span> for the JS I have $("button").toggle( function () { $("span").removeClass("big"); $("#one").addClass("big"); }, function () { $("span").removeClass("big"); $("#two").addClass("big"); }, function () { $("span").removeClass("big"); $("#three").addClass("big"); }, );this cycles through and does what i need, however
ajax + crossdomain + proxy
Hi folks, here is the challenge: we have one server A where the clientbrowser is logged in. Now the server A wants the Client to call a url of another server B wich is not in control of server A and return the content to server A. The client should be like a proxy between server A and Server B. Is this possible with jquery? Thanks for your time. zalubom
jstl + jquery photo gallery
I have to simply create a gallery which has prev and next actions. I get the photos from backend. <c:set var="destPhotos" value="${local.destinationPhotos}"/> if i do a foreach, i can get all photos. but i don't want that. I need to navigate through each photo. ${destPhotos[0].imgUrl} will give me first photo when the user clicks next, i just need to add the count. Please help.
Selecting / operating on multiple elements
Hi All, I am creating an FAQ type page with rows of questions that will drop down the respective answer when clicked. I have it mostly working, except I can't find a way to close all answers before opening the next one. I have tried everything I can think of (or search), but to no avail. I am using the following code, where QQQ1/2 are the questions, and AAA1/2 are the answer divs: //Question/Answer $(".QQQ1,.QQQ2").click(function () { // check the visibility of the next element in the DOM if ($(this).next().is(":hidden"))
Dynamically loading javascript source from a string into the DOM using Jquery
I'm experimenting with dynamic loading of javascript using JQuery. So basically I have a loadScript function that accepts either the URL of a JS file or a javascript source in a string. For the former, I create a 'script' element, set its src attribute to the URL of the file and insert the element into the DOM's head element. So far it seems to work nicely. For the latter, I create a 'script' element, set its innerHTML to the JS string and insert it into the DOM's head element. This doesn't work
.position() retunrs the same value that .offset()
Hello, I´m new in jQuery, and I have read documentation about .position() (relative to the offset parent) and .offset() (relative to the document). I have an <ul> within a centered <div>, and I cant figure out why both, position and offset, return the same value, the value relative to the document. The problem is .position(). It should return 0 and it returns 472, that is the correct value returned by .offset(). I have tried changing the elements position css attribute, but it still returns the same
Persisting Positions
Hi , i have implemented a Draggable interface similar to igoogle. Now the structure of each draggable is linked via the sortable and connectwith options if JQueryUI. Now don't direct me to JQueryUI forums because i have used JQueryUI. The question is pertaining to JQuery :D Structure: <div class="column"> <div class="ui-widget"> </div> </div> there are six of such divs, Now i know how to get the children of a column like below $.each($('.column'), function(i,val){ alert($(this).children().length)
How To Filter MySql Data Using Jquery?
Hello All. I have a database which currently holds clients name,city,county,post code,country etc. I'm looking for a way to filter this data based on user input. So when a user clicks on a certain name then the table of data filters automatically, then when the user clicks on a certain county it filters the already filtered data even more and then finally when the user clicks on a country it filters even more. The three inputs will be on the same page in a single div. Sorry if thats a little
Break text in DIV after 5 linies of text
Hello folks, Does anyone have a possible solution for this problem: ? I have a DIV with a text in it. But I have to break the text into to variables after 5 linies: fx: "lorem ipsum <br> lorim upsam fdfs sdæl <br> --divide-- <br> lorem ipsum lorem ipsum" I can not use .length because the <br> starts a new line. I can not find a solution the use a "line-counter". Does anyone know how to do this?
The best way to fade in so that it doesn't conflict if js is off or not supported
Hi There, I have a query that has been bugging me for ages. What is the best way to fade in an image on a page load so that the image is visible if javascript is not supported and does not jump around all over the place if it is supported. What I have found is that I can make it work using either document ready or on window onload however the images all load first and the page goes all crazy for a few seconds before the script actually does what it is supposed to. What I do not want to do is hard
How can dragable objects recognize if they are "placed over" other objects
Let's say I have two images. I make one dragable. I physically move one image directly over the other. While my mouse is pressed I release it. The image underneath recognizes and gives a message indicating it's covered by the other????
Error while using ajax with jquery
Hi, I have an HTML page with a button. I am trying to execute a function from one of the js file "myapp.js" when I click on the button. The function is something like function changeMapLocation() { var addressval = $("#address").val(); var address; var url; var googleUrl= "http://maps.google.com/maps/api/geocode/json?"; var sensor = "&sensor=false"; if(addressval != null && addressval !="" && addressval.length!=0) { address = "address=" + encodeURIComponent(addressval); $.ajax({ url:googleUrl+address+sensor,
$.getJSON - function
I'm try parse "country" from Url-source <html><head> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> <script type="text/javascript"> $(function () { $.getJSON( "http://www.ringcentral.com/api/index.php?cmd=getCountries&typeResponse=json", function (data) { var $test = $("#test"); $.each(data.result, function(country) { $test.append("<option>" + country.name + "</option>"); }) } ); }); </script> </head><body> demo: <select id="test"></select> </body></html>and receive - null record
.click to trigger 2 different functions
Hi, with 1 click i would like to trigger 2 different funcions that affect different divs/images .. first it's lsupposed to oad some images into a div, and then resizing them ... I can only get the first function to work, the height resizing does not work. Could someone have a look at the code and help me out please ? $(document).ready(function() { var height = $(window).height(); $("#comercial").click(function() { $("#navcontainer").hide().load("gallery.html #comercial").fadeIn('slow').scrollTo(
Sortable list, remove element with effect
Hi everyone, i have a sortable list and i want to remove an li-element. But before that there should be a fade effect, and that is the problem. function deleteVote(id) { jQuery.ajax({ type: "POST", url: "?page=ServerControl&id=123", data: "deleteVote=" + id, success: function(req){ if (req == "1") { jQuery("#votelist > li").each(function(n,item){ if (item.id==id) { //jQuery(item).effect("fade",
Get receiver element's id for dragable elements
I want to use .css() to restyle list elements, i have 4 lists, they are connected. But i need to know where element dropped. I can read where it comes from with this code; ui.sender.attr('id') How can i now where it dropped? This is the code if it's necessary; $(function() { $("#sol, #sag, #orta, #deaktif").sortable({ opacity: 0.6, connectWith: '.bagla', scroll: false, receive: function(event, ui) { var ComeID = ui.sender.attr('id');
Jquery .ajax , .get and .getJSON broken with firefox 4.0 beta 3
The callback method is never executed although I tried all varieties including the .ajax low level method with success and complete function. The same functions work with safari.
tabs with leading text
Hi: I'm new to the forum but have been implementing jquery for some time. I'm no coder, so please speak slowwwly ;) I would like to incorporate the tabs w/toggle as seen on this page with the rotating UI tabs show here into my site. What I want to do is to initially show the boxes as displayed in the image below. This means the tab + an image + initial text... When a tab is selected i want the colored div to expand and overlap the other boxes so that the full text is visible. is this doable?
Form Post
Sorry for the basic questions but I am brand new to jQuery and could really use some help. 1). Once my form posts, all the information stays in the post. How do I get it to blank. Is this where I set cache to false or is that something else? 2). I am using classic ASP and once I do my insert to sql server I retrieve the new record's ID, how do I get that returned back as part of the post? Some background: I am trying to submit a form, pull the id, and then requery all records for a user and display
table column height problem
http://www.drama.com.tw/test/tr.html I want to make two table's column height the same, it works fine in all browser besides "IE!!!!!!!" How to fix it?
var numElements question
I have been developing a web-form for my company, and I really can't get this little piece to work. I am basically trying to take an input field, and have the page read that input (a number between 1 and 28) and then displaying that number of a series of form fields. I have some of the code, and I really just need some help adding an id to the input field that is interacting with the script. So here is the code I have... <head> <script src="jQuery.js" type="text/javascript"> var numElements
After element is created event?
Imagine an element with a specific selector getting created and then once the element exists and the selector is applied, all of the behaviors are applied (events, styles and plugin methods). Here is an example: $.create = function(elementTagName) { return $(document.createElement(elementTagName)); } $.create("div").addClass("myDiv"); now what I would like is a method that would apply behaviors after the element exists in DOM. $.onElementCreation(".myDiv",function(){//apply behaviors here}); This
Combination Image captions and Jquery Vgrid
Hi, I'm trying to make a page with thumbs (including image captions) in combination with the Jquery Vgrid system. For the Image captions I found this information: http://web.enavu.com/tutorials/making-image-captions-using-jquery/ And for the Vgrid: http://blog.xlune.com/2009/09/vgrid/demo006.html http://jquerystyle.com/2010/03/25/vgrid I've already a html, based on the tutorial 'Making image captions using jQuery', but I don't know how to make a combination with the Jquery Vgrid. Does anyone have
Not working ?
Hey this is the website http://mobile.sheridanc.on.ca/~mccrankr/majorassignment/result.html The jQuery only works in firefox, why doesn't it work in any other browser?
How to get a current page address with jQuery?
Hi! I was searching for this and found only: var local = window.location.href; Is there any other way to achive this?
Next Page