jquery

How to position an element below a text box carret in javascript?

I have a long text field and what I want to do is that when a user types an '@' character a list of users appear just like a typical auto-complete. However I want the list of users to appear below the '@' character which could be 20-30 characters in from the start of the text box. I've found many jQuery auto-complete plugins but none t...

Server calls happening twice

I am using ruby on rails at back & javascript on front end to communicate. I am using $.post() / $.getJSON & both of these calls are happening twice ! I am seeing logs of two different calls in server & if I print something in callback function , its printed twice as well. I am pretty sure its nothing due to my code as even simplistic r...

How to put a banner on a web page

I have downloaded a web banner. I want to put it in my project, certainly at the top side. How do I do that? ...

how to invoke an event after losing focus from a textbox, asp.net mvc

I have two text boxes A, B using (Html.textboxfor). TextBox 'A' is enabled and TextBox 'B' is disabled. When I type values in Textbox 'A' and click outside( moving out the cursor from the textbox), TextBox 'B' should be populated with somevalue. For example : iam entering value of TextBox A = "King", if the focus is lost from the box,...

How do I check the type of a child inside a div?

I want to check the type of an element which is placed inside a div. I'm not able to reference the child element. I have tried using the following: $("#"+styleTarget).siblings(0).get(0)tagName Where styleTarget is a variable holding the id of the parent div. ...

Jquery: Why create a variable for something you're only referencing once?

So for something like this: Jquery: $(document).ready(function(){ var container = $('.rotate_container'); var images = container.find('img'); container.everyTime(10, function (){ images.each(function() { container.animate({scrollTop: $(this).offset().top - 165}, 2000).delay(1000); }); }); });...

Change value of hidden form field to range of entered number

Hi, i have a simple text input field users put in a number. I need to check which range the number matches (e.g. >10 or <1 ) and save a separate key/value for that range in the database. I thought about a hidden field that changes its value as the user enters data but i don't know how to determine the range. (I cannot modify the submit...

Jquery Popup with PHP

I am using a j query pop up for my web application.I need multiple pop up in same page for different purpose.I am using different id to invoke these. The problem is about Click out event!(out of popup). I am using the script as follows to close the layer //Click out event! $("#backgroundPopup").click(function(){ disablePopup("#...

jquery chaining in IE

I have a jquery plugin that i call as such : $(function() { $('.link_class').jquery_plugin() }) with many anchor tags in the body <a href="http:...." class="link_class">link 1 </a> <a href="http:...." class="link_class">link 2 </a> <a href="http:...." class="link_class">link 3 </a> the jquery plugin is setup this way : $.fn...

removing unwanted tags from html body with jQuery

I have inherited some legacy HTML in which it has the following elements in the body of the code: style meta title How do i remove these with jQuery? ...

Trouble with Cookie persistence in IE

Hi all, I am setting my cookie when user click a certain link on my web page. I am using jQuery Cookie plugin developed by Klaus Hartl. To set the cookie value I do the following: $.cookie("lanVal", "tv", {expires: 3}); But when testing the cookie functionality, I see that IE does not save the cookie properly. All other browsers ret...

jquery :checked with display:none

I'm trying to get the checked radio buttons in the page, and it works until I put the style="display:none;" attribute (I'm putting this attribute for design reasons - replacing the default radio button). Is there another way to selected the checked radio buttons the checked attribute? ...

Javascript/JQuery GetDay()

Hi guys, I have the following code: http://jsfiddle.net/SPWWx/ I'm completely new to javascript, this is my first time using it. The values of the HTML selects MUST be 01,02 etc, that's why I had to use a big long if else statement. The values have to be submitted to an application on a server, which is extremely fussy about what way i...

jQuery unbind , bind function not working in IE8

Can anyone help me to differentiate this two line , one is working fine on IE as well as FF, but second is working fine only in FF . $(window).resize( function() ); // Works in both IE and FF $(window).unbind('resize').bind('resize', function() ); // Works only in FF Thanks in advance ...

AJAX function to populate textfields based on dropdown list

I have not done much on Ajax before and was wondering if I could do this using jQuery. This is what I have at the moment: Database table 'airports' - this contains id, name, town, postcode Dropdown list with Airport names (the entries are generated from the database) 3 form fields (name, town, post code) I want to be able to select ...

$.getJSON for progress bar NOT working in Safari and Chrome (but OK in IE6+ and FF)

Hi folks This one's perhaps a little long-winded, but it's really baffling me and a couple of other people. We've got a progress bar that's updated during file uploads. The JS is here (too much to paste into this body). Basically, the form submit event starts a timer loop which, every 2 secs, fires a $.getJSON() call to the server to ...

Asp.Net MVC Ajax refresh of table contents

Currently I have a table on my page which I need to refresh using Ajax. I was intending to render the table in a partial view and then just call an MVC render-partial update, which would have been nice and simple. However, I've since added a bunch of sorting/filtering controls in the header of the table. I would now like to refresh the ...

Google Maps JS API v2 - jQuery number to word translation thingy

Hi again guys! Ive got a problem, Im using jquery for my googlemaps thingy Im doin and Im gettin a number from an php array and I´m reading from it via a for-loop and want to translate that number into a word, for example I get the number 1 in the array and then I´d like to translate that number to the word "Core-router". And return t...

How do i Open a page in a dialog box using jQuery?

I need to open the login.aspx page in a dialog box when the user clicks the 'login' link. I've looked at jQuery UI Dialog, but it looks like it can't open whole pages from a given URL? Do you guys have any tips to what I can use? ...

Trying to toggle a panel whilst changing the icon to 'view more' and 'view less'

Hi guys, I've just started learning jQuery/javascript, so this might seem like a really basic question, but it's annoying me nevertheless. I have a panel of 6 <li>s, 3 of which are hidden until clicking on the 'view more' link at which point the panel toggles to reveal the other 3. The icon is changing from 'more' to 'less', but then n...