jquery

More efficient comparison of numbers

I have an array which is part of a small JS game I am working on I need to check (as often as reasonable) that each of the elements in the array haven't left the "stage" or "playground", so I can remove them and save the script load I have coded the below and was wondering if anyone knew a faster/more efficient way to calculate this. Th...

ui.selectmenu.js is displaying undifined values in Joomla?

Hi, I'm using the jQuery ui.selectmenu.js within a Joomla template but it's adding a load of undifined values to the list of options. I cannot work out where these are coming from? Any help would ba appreciated, the site can be viewed here: http://www.rhubarbproperty.co.uk/ ...

How can I use a variable as a jQuery option value?

I currently have jQuery code that looks like this: if ($.url.param("s") == "error") { $.gritter.add({ title: 'Error!', text: $.url.param('message') }); } I'm checking to see if the request variable s exists in the url (ie. http://example.com/?s=error&message=this%20is%20my%20message and then showing a popup...

How to submit the correct div elements (not the div that's hidden)?

Hello, I have the following code working fine but the problem is that it always submits the first div (article) even though it's hidden. My question is how do I submit the form and the elements in the form in the div that's shown? (if I select Music radiobutton, I want to submit the input elements of the Music Div not the Article div....

Stop Duplicate Ajax Submisions?

Hi I am wondering what is the best way to stop duplciate submissions when using jquery and ajax? I come up with 2 possible ways but not sure if these are the only 2. On Ajax start disable all buttons till request is done. 2 problems I see with this though is I use jquery model dialog so I don't know how easy it would be to disable th...

jquery to php (wait for php script until result/finish)

Hi, I am executing a php call from javascript(jQuery), php sript is sending result back. The problem is that these php scripts are taking some time (milliseconds), and java script is not waiting for them to finish, thus variables are not getting initialized with correct values. The code is simple: $.get("php/validation.php",{'email':em...

DNS Lookup in simple C#/asp.net ajax call is extremely slow

I'm running this out of the VS 2008 debugger on Windows 7, running .Net 3.5. The idea was to make all ajax requests with jQuery only, rather than .net, following some tutorials online. Default.aspx -> HTML page, jquery triggers method in Default.aspx.cs http://pastebin.com/pxBvKA2H Default.aspx.cs -> C# Webform, just defines a GetDat...

jQuery sortable fails with overflow: auto;

I've developed a form that uses the jQuery sortable. The form has several other jQuery and general javascript scripts. I have specified overflow:auto; for the parent div of the sortable list. Everything works very well on my WAMP development installation (on WinXP). However, when I move it to a hosted server (Linux), the sortable lis...

how to show an ajax loading image next to a button after clicked using jquery

i have a button that runs an ajax get which takes a long time. what is the easiest way of showing an ajax loading image RIGHT BESIDE to the right of the button. i may move the button later in the layout so i wanted this to be dynamic (compared to a hard coded div in the layout) after the click event (before the ajax was called), i tri...

jquery queue problem..

$(".menu-container").animate({top:"25px"}); $(".menu-container").animate({top:"-900px"}); $(".windows-container").animate({top:"-730px"}); hello sir.. i got a problem on queue in jquery.. what i want to do is $(".menu-container").animate({top:"25px"}); ----execute first then after this, $(".menu-container").animate({top:"-900px"})...

Algorithm for 'Shift + Clicking' items in a collection to select them.

Hello, I am trying to mimic the file selecting from Windows Explorer in Javascript. I notice Windows Explorer has two types of "selecting". One is the normal selection which highlights the file and the other one is a dotted line which means that file is currently focussed on. So I am using "selected" and "focus" as css classes. Here yo...

jQuery: Preventing an event from being attached more than once?

Essentially, I have an element FOO that I want when clicked to attach a click event to a completely separate set of elements BAR, so that when they're clicked they can revert FOO to its previous content. I only want this event attached once. When FOO is clicked, its content is cached away in $back_up, and a trigger is added on the BAR s...

jQuery to PHP: no input... kinda

Hi all, I'm using jQuery to post HTTP requests to my PHP page (Apache/Linux, if that matters). I carefully validate on the client so that empty requests are not sent. However on occasions, I'd get an empty request like this: - $_POST collection empty ($_GET collection also empty); - Content-Length is nonzero (a number below 100, consi...

jquery queue problem part 2..

i got a problem again.. $(".menu-container").animate({top:"25px"}, function() { $(".menu-container").animate({top:"-900px"}); $(".windows-container").animate({top:"-730px"}); }); $(".menu-container").hide(function(){ $(".webPageFrame").attr("src",""); addMenuButtons('main-menu',MenuTitleMain); ...

why including www in a jquery load causes it to fail?

Could someone enlighten me as to why including www in a ajax request causes it to fail. i.e. This works: $('#mydiv').load('http://mydomain.com/getitems'); But this doesn't (returns nothing) $('#mydiv').load('http://www.mydomain.com/getitems'); Note that www.mydomain.com/getitems is a valid domain, in the sense that if I point my web...

"Permission denied" with Internet Explorer and jQuery

I try to do an AJAX call with jQuery and $.post in Internet Explorer, but all I get is an error saying "Permission denied". The problem is kinda weird since it occurs only when I access a page after I was on any other page. For instance I type the URL in the adress line and let IE load the page. Then I click on a button so the script s...

With JS add default date on TextBox

<asp:TextBox ID="txtDate" runat="server" AutoPostBack="true" OnTextChanged="txtDate_TextChanged"></asp:TextBox> how can with Jquery add default date. I do not know where and when to call this code: function addDefaultDate() { if ($('#txtDate').val().length == 0) { var now = new Date(); $('#txtDate').text(now.getDat...

Selecting a link with jQuery

I want to be able to search for a substring inside the href's in the below code and select the link AFTER the selected string. So, for example the string "page=2" would access the third link. Thanks in advance. <div id="container"> <a href='test.php?page=1&title=a title'><a title</a> <a href='test.php?page=2&title=another title'><anoth...

How do I simply hide a tooltip?

I have a image set as a link, with a title which is used for a caption in a lightbox. I need the "title" set in order to keep the caption for the lightbox, but I don't want the tool tip to pop up when I hover over the links. Anyone got a easy css fix? Or does this need to be done in Javascript? ...

JQuery-AJAX: No further request after timeout and delay in form post

I got a form containing multiple checkboxes. This form shall be sent to the server to receive appropriate results from a server side script. This is already working. What I would achieve now: 1) Implementing a timeout: This is already working, but as soon as a timeout occurs, a new request is not working anymore. 2) Implementing a de...