jquery

jquery ignores response

Hi anyone see why my alert won't work? <script type="text/javascript"> function SubmitForm(method) { var login = document.form.login.value; var password = document.form.password.value; $.post("backend.php", { login: login, password: password, method: method}, function(data){ ...

Why does this JQuery function not work in FF?

The following JQuery function is not working entirely. IE 7 processes both alerts, but FF 3.0.10 only the first alert is fired. What did I do incorrectly? function submitClick() { var submitButton = '#<%=SubmitButton.ClientID%>'; alert('got here'); $(submitButton).click(function() { alert('got here too'); ...

jquery ui.slider: add click event to display/hide handle

I am completely new to javascript and jquery. My programing knowledge is... nonexistent, I just started some days ago with some simple tasks like replacing a css class or toggling a div. So I want to apologize if I'm treading on someones toes by asking newbie-questions in here. But I hope that someone can help my and solve my problem. I...

JQuery .load problem

Hi, I have a webpage with search form fields and on click of submit button i do an Ajax call and fill a div with results using Ajax.BeginForm The results have paging links to handle paging. Problem is after the Ajax call I have this Jquery code that should fire when one of the paging links is clicked. But they do not fire. Is this be...

JQuery How to extract value from href tag?

Hi, I am new to JQuery. If I have the following tag. What is the best JQuery method to extract the value for "page" from the href. <a href="Search/Advanced?page=2">2</a> Malcolm ...

Ajax jquery confusion

This is probably straight forward but I'm a newbie and I need help! If I make an Ajax request which when successful replaces a section of the DOM with other data, how do I make the new data accessable to jQuery? ...

Jquery checkboxes manipulation help

Using jquery, how can I: 1- Have all checkboxes on a page turned checked on or off? 2- Loop through all the checkboxes on the page which are selected. I.e something like this $(sel-cboxes).each(myFunction); So myFunction would be called on each selected checkbox. Thanks in advance! ...

How to get a count of all checked checkboxes on a page

I want to count how many checkboxes a user has selected. For example, from a group of 10 checkboxes if he selects 5, then I want to be able to count it. Using the line: $(":checkbox:checked") I can select all of the checked checkboxes, is there a way to get the count of all the elements that are returned by that statement as well? ...

Dynamic Superfish menu problem with IE

Almost done with my menu, but I have a problem I need to remove some parts of it depending on the user. It is ok in firefox but on IE when ever I set an li to display none it leaves a blank space instead. Thanks. ...

Using ASP.NET MVC and JQuery how do I run a JS function for each item in a list on load?

Imagine a view that is designed to show a list of items of type Foo: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Foo>>" %> Now the page displays the list of items of type Foo: <table> <tr> <th> Name </th> ...

Dom problem within AJAX request

I have been stuck on this problem for almost 2 days now, consider the following code: '.country-select' occurs twice in the form ( input), $('.branch-row').hide(); $('.country-select').change(function(){ console.log($(this)); country_select = $(this); $.get('get_country_branches.php', 'country=' + $("'#" + country_s...

background is not going to the foreground with jquery

Hello, my question is if it would be possible to get the background images to the foreground I created a mask from an example with the div's z order to 9000 and the div containing the form to 9999 Sofar that works But if I use a class with a background image, it will not show Y tested everything on a testpage without the mask and it...

Howto get iframe linking to internal document source using javascript/jQuery?

Hi there, I have an iframe with id "appframe", the source is page.html and it's on the same server. I want to get the source of the page using jQuery. alert($("#appframe").contents().find("html").html()); returns <head></head><body></body> even though the document does not contain those tags, it only contains "Default page" - any ide...

Sumbit form with Enter key and search for the cursor

Hi, I have a text box in my page which the user will type something to submit. However, I do not want to have a submit button but instead I want to listen for the Enter key press in order to submit. The thing is, there will be couple of textboxes in this one page and I only want to submit the textbox that has just been typed into. I ...

jquery toggle hide show question

what is the most efficient way to shorten this? $('.img').click(function(e) { if ($(this).attr('id') == 'myid') { $('#a').hide(); $('#b').show(); } else { $('#a').show(); $('#b').hide(); } }); and does anything change to your answer if another option is added with an else if ...

outerHeight() and inner pictures

Hello, I've an issue at the first load of a page with outerHeight. The value returned by outerHeight() is a multiple of 27. jQuery $('.entries').each(function(r) { $(this).attr("value", $(this).outerHeight()+15); }) HTML : <div class="entries"> <div class="container_entrie"> <span class="meta"><span class="title">Daily Inspi...

How to access main window element from iframe

I hope someone can help with this issue. I have a popup iframe using lytebox. I would like it that when i click a link in my iframe with the class "mylink" that it executes the ajax call and update a div in my main window with the id "mydiv". I know how to do the onclick events and the ajax call but i do not know how to access the "mydiv...

How can I use fancybox using onclick?

Hi I am trying to make use of JQuery and Fancybox. This is how it should be used: http://fancy.klade.lv/howto However, I can not generate many ids for "a href" and I do not want to make many instances of fancybox ready. So I want to be able to use one fancy box instance for many hyperlinks that do the same thing. Whenever any of thes...

How to retrieve the value of a text area in javascript

I have a form with a text area input. I'm using JQuery to submit the form via an AJAX request in order to update a database. My problem is that I'm having difficulty retrieving the data from the text area input. If the input has an id of "txtBody" I have tried: var body = $("#txtBody").val(); // This adds 'undefined' to the database v...

jQuery and Rails

I'm writing a Rails app and need to plug in this little bit of jQuery code, but I don't really know how to get it to work. Here's my controller code: class ChatroomController < ApplicationController def send_data @role = Role.find_by_id(session[:role_id]) render :juggernaut do |page| page.insert_html :bottom, 'chat_data',...