jquery

How can I call a JQuery function?

Ok, this is like two question in one! Why is this JQuery function call failing? or how should I call the JQuery function? Firebug tells me that $('#login').slideup is not a function. setTimeout("$('#login').slideup('slow');",2000); How can I declare a JQuery function externally (not binding it to anything and not after document().read...

Not getting a variable value?

I am not getting the value of the variable of "img_srt" in load function, can any body helps me? $(document).ready(function() { Get_var(); }) var img_srt='<div>address</div>'; function Get_var() { $("<img />").attr("src","http://www.google.com/intl/en_ALL/images/logo.gif") .load(function() { if (this.hei...

jQuery: find id of of a form field

I am creating a dynamic form where the user will have the ability to add a set of inputs to the form. The html looks like this: <form> <input id="title1" class="title" name="title1" type="text" value=""> <input id="productionCompany1" name="productionCompany1" type="text" value=""> <input id="year1" name="year1" type="text"...

jQuery.ajax() + empty JSON object = parse error

I get a parse error when using jQuery to load some JSON data. Here's a snippet of my code: jQuery.ajax({ dataType: "json", success: function (json) { jQuery.each(json, function () { alert(this["columnName"]); }); } }); I get no errors when parsing a non-empty JSON object. So my gues...

What is wrong with my link generated from PHP?

In my code I am just hyperlinking to an anchor tag for a PHP function when I click My code is below, another.php is called by AJAX, index.php from JQuery. another.php <?php echo " <a href='my.php?action=show&amp;id=".$fid."' onclick=\"return display('".$fid."');\"> "; echo "" .$fname."</a> "; ?> The hyperlink does no...

jQuery hyperlinks - href value?

Hi, On my website I use jQuery to hook the events of elements, namely hyperlinks. As these hyperlinks only perform actions on the current page, and do not lead anywhere, I have been putting a href attribute of "#" in: <a href="#">My Link</a> However in some browsers this causes the page to scroll right to top which is obviously undesi...

Navigation images not displayed properly in jQuery lightbox

From this aspcode.net page at the bottom (under attachments) you can download the project. For some reason when I run it the Close Button and the Next and Previous Buttons don't work. Well I mean it does work but it does not show the actual images. Can anyone figure it out? It should be easy but I just cant get it to work. ...

datepicker doesn't work in ie7

Hello, I have implemented a ui datepicker which works perfectly in FF but not in IE. See here link try to click on the "Geboortedatum" field. What's going wrong? ...

Debugging jQuery with Firebug

I've seen a ton of old posts out there on how to try to debug jQuery in Firebug. Anyone have a good way yet cause I do not see one at all that works. ...

how to control the numbers of characters (numerics) with jquery

i need to control the numbers of characters in an input field using jquery ... ive got some control already but, i dont know what else to do .... var foo = function(){ if($('#foo1').val() == ''){ $('.foo_foo_c').load('../html/message_error_number.html'); }else{ $('.foo_foo_c').load('../html/foo_foo.html',function(){ ...

Empty jQuery UI Tabs

How can I empty (remove all tabs) a jQuery UI Tabs? EDIT: I'm not trying to remove the tab functionality, but to empty all tabs to add new ones. I'm trying with: for (var i = $('#content').tabs('length') - 1; i >= 0; i--) { $('#content').tabs('remove', i); } But tabs('length') always returns 0, even if there are some tabs added ...

Apply an ID to a GridView

Before you say it, I'm perfectly aware that a data repeater could do it, but I'm looking for the solution using a GridView. I'm implementing a jQuery feature and require unique ID's to be applied to individual rows in order to respond to click events in the correct manner. I can't see how you're supposed to apply values to an ID or a r...

AJAX problem

I seem to be having a problem with this script, it stops after alert 5. var _v = 0; var _v2 = 1; function landscapeUpdate(){ alert("1"); var wrapperId = '#gameWindow'; alert("2"); var postFile = 'game_window.php'; alert("3"); _v++; alert("4"); _v2++; alert("5"); $.post(postFile, { v2: _v2 , v...

jquery autocomplete question on data feed

Hi there, I'm looking for a simple way to feed autocomplete with a dictionary and have it displayed like this: "value_to_display": value_that_gets_inserted, eg when one writes Pink, "Pink Floyd (England)" appears and if he chooses it, Pink Floyd gets inserted into the input field. I have my data locally, no ajax is required so this ...

Controller's Json() Method Not Returning Array

Hi All, I'm just building my first MVC application and hitting a problem trying to perform a search using AJAX/JSON. The problem seems to be that the JSON returned by my controller is not an array meaning that I can't use jQuery's $.each method to iterate over my items. I'm trying to search for a user by e-mail address. I've got a Sear...

jQuery on slow computers

I'm creating an online game using jQuery. Due to lot of fade effect for slower computers I did an option that sets jQuery.fx.off = true; That caused a problem with this code: $('<div>'+msg+'</div>').fadeOut(5000,function({$(this).remove()}).appendTo('#msg'); This code display messages in the #msg div, then after 5 seconds message is g...

jQuery .each() - Practical uses?

I am working on trying to better understand the jQuery.each() method. Here's an example I came up with, not very practical, but it performs an action on each selected item from the selected set of elements returned: // Loop over each link. $( "#links a.number" ).each( // For each number, run this code. The "intIndex" is the // loop i...

jquery - fastest way to remove all rows from a very large table

I thought this might be a fast way to remove the contents of a very large table (3000 rows): $jq("tbody", myTable).remove(); But it's taking around five seconds to complete in firefox. Am I doing something dumb (aside from trying to load 3000 rows in to a browser)? Is there faster way to do it? ...

Properly loop through JSON with jQuery

I have the following JSON: { "status" : "success", "0": { "link" : "test1", "img" : "test2", "title" : "test3" }, "1":{ "link" : "test4", "img" : "test5", "title" : "test6" } } Obviously 0 and 1 are objects themselves and I would like a proper way to loop through all data in this object, the 's...

How can an Ajax callback realize that a user's authenticated session has timed out?

I'm using django and jquery to implement authenticated sessions and Ajax requests. I have authenticated session timeouts to log authenticated users out after a long period of inactivity on my site. Some of the pages on my site have a lot of AJAX calls in them that require the user to be in an authenticated session. When a user leaves ...