jquery

How can I keep AJAX from complaining when the window closes?

I have this... well okay not really this but this is the important stuff: window.onbeforeunload = function() { return 'you sure?'; } ... and I have this inside my $.ajax() calls: error: function(xhr, textStatus, errorThrown) { if (textStatus == 'timeout') { HandleError('Connection error.'); return; } ...

How do i refresh my Twitter API every 15 seconds?

I was successful in installing the TWITTER API jquery script, but I can't figure out how to make the script refresh with the latest tweets without refreshing the entire page IN 15 SECOND INTERVALS. Is it possible to use a .load or refreshID to reload script? Can I also include a fade in and fade out when the function reloads? Anyone d...

Using jquery to generate a Slug from Title (on lost focus)

I want to use jquery to create a request to a controller action posting Title and getting back Slug. This needs to happen when user enters a title into a Title textbox on the form and then uses tab or enter to move to the next field. I do not want to convert title to slug in Javascript - I have a controller action set up to do it and it ...

jquery each on a JSON api

I'm trying to loop through the NY Times' search API. The resulting JSON looks like this: {"offset" : "0" , "results" : [{"body" : "NEW ORLEANS — The hemorrhaging well that has spilled millions of gallons of oil into the Gulf of Mexico remained capped for a second day Friday, providing some hope of a long-term solution to the envir...

Google chart formatting

I have the following script which I need to modify a little. Here is the json: [ {"User1":{"v": 50.00,"f": "£100"}}, {"User2":{"v": 10.00,"f": "£20"}}, {"User3":{"v": 10.00,"f": "£20"}}, {"User4":{"v": 10.00,"f": "£20"}}, {"User5":{"v": 20.00,"f": "£40"}} ] and here is the script: <html> <head> <script language="...

How do I remove the square brackets at the end of a JS variable name during AJAX calls?

I currently have the following javascript array: var stuffs = ['a', 'b']; I pass the above to the server code using jQuery's load: var data = { 'stuffs': stuffs }; $(".output").load("/my-server-code/", data, function() { }); On the server side, if I print the content of request.POST(I'm currently using Django), I get: 'stuffs...

jQuery tablesorter - sorting by rows and columns, not just columns

Hi, I have this problem. I have a big table with categories in THEAD and in TBODY I have authors of articles. When i apply tablesorter on this table, I can sort it by columns But I want to sort it by rows too, so I can tell, how many articles author has in which category. Is it possible? Oh I forgot, I am using this tablesorter: http:/...

jquery carousel jumping bug

Hi, I've built a horizontal accordion with jquery. I'm having a problem with it. When it animates from one panel to another there's a jump at the right hand edge of the carousel. I've tried everything to get rid of this...adding widths...changing the js..removing whitespace from html etc..any suggestions? http://boudaki.com/testing/car...

jquery array question

I have the following : <script> $().ready(function() { $("#myVal#").blur(function() { var arr = jQuery.makeArray( $("#myArr").val() ) if ( $("#myVal").val().indexOf(arr) == -1 || $("#myVal").val().indexOf(arr) ==0) { arr.push($("#myVal").val()); } $("#myArr").val(arr) }); }); </script> <form action="" method="post" name="myF"...

why can't an element be accessed from the name attribute in Jquery

what is the main reason that we cannot access the element from its name attribute rather it can be accessed from id attribute <input type="text" name="textname" id="textid" value=""> <input type="button" name ="buttonname" id ="buttonid" value ="button" $(document).ready(function(){ $("#buttonid").click(function(){ $("#tex...

jquery trigger - 'change' function

I have a radio button set called "pick_up_point" and I have a change handler to detect the radio button that is checked. In the change handler I call a function "clearFields()" which basically clears out the input fields. function clearFields() { $("#Enquiry_start_point").val(""); $("#Enquiry_start_town").val(""); $("#Enquiry_start_p...

jQuery Tools: How to close an overlay?

$("a[rel]").getOverlay().close(); $("a[rel]").close(); Both don't work. $(document).ready(function () { $("a[rel]").overlay({ mask: '#3B5872', effect: 'apple', onBeforeLoad: function () { var wrap = this.getOverlay().find(".contentWrap"); wrap.load(this.getTri...

jQuery::when I use fadeIn() my page moves its focus!

Hello. I have a simple HTML page, and some javascript using the basic $(#element).fadeOut method from jQuery on mouseover event. I also use the $(#element).hide() method. But my page focus shifts up! Meaning: if I scroll down a bit, and mouseover the element (which toggles the script), script is executed well, but my scroller goes up i...

Opening a YouTube video in a lightbox or something on page load

My client wants a YouTube video (embeded object) to popup when a user comes to their site. Does anyone know how it do this and what to use. It should be a lightbox or shadowbox, something that's not a popup. The video should run automatically and ideally close when it's over. Maybe I can specify a time until auto-close or something? ...

jQuery UI Datepicker detect select

When a date is selected by the user, I want to check a condition and cancel the selection onSelect: function(dateText) { // code to cancel selection } How do i cancel it? ...

distinguish between events original and cloned html block

Hi , I am using jquery 1.3 , When i clone the element with clone(true) all the data + event are copied , but the problem is to distinguish between event of the original html block and cloned html block. When i tries to fire event to cloned html blocks then original html block's event also get fired. so now the big problem is how to ...

Grab some Array data from a Select tag

Hi all, I am learning JQuery. I got s Select Tag with some options in a very simple form like this: (The form was generated by the Server and the values in each Option was retrieved from the database.) <select name="data[Site1][quotenumber]" id="data[Site1][quotenumber]"> <option name="editquote" value="[29,1]">1</option> <option nam...

ajax response does not write to html page what to do?

languages used: html, javascript/jquery, and php 5.2 So I created this function that onclick creates a "group". For simplicity, we'll say this is a group (aka the response from ajax.): <div id="group1">Group #1</div> This is where the groups go: (html page) <div id="groups"> <!-- groups go here --> </div> So the user creates g...

How to use delay the execution of a script until something else is done?

I have an ASP .NET page where I use jQuery. I used this function to search an element in the DOM $(document).ready(function() { currentID = $('#ctl00_ContentAreaPlaceHolder_hfCurrentID').val(); if (currentID != "") { window.setTimeout(function() { $("div[class^='element'][ID='" +currentID + ...

Is PHP socket a viable option for making PHP jQuery based chat?

Hello all, I am developing a chat module for drupal. I plan to provide multiple backends for chat message processing. I initially started with AJAX and have now included long polling technique in it. Then I came across ape(ajax push engine) and it looks promising. But it will require server side installation of ape for the chat module t...