jquery

Jquery parent div hide logic hides child dropdown menu on mouseout

I have a row of divs with the class "itemcontainer" that show a group of action icons on mouseover. One of the action icons has a dropdown menu with an absolute position that shows on mouseover. The challenge I am trying solve is the fact the dropdown menu spans over the item container and when you move the mouse down to the dropdown m...

Can I make a <button> not submit a form?

I've got a form, with 2 buttons <a href="index.html"><button>Cancel changes</button></a> <button type="submit">Submit</button> I use jQuery UI's button on them too, simply like this $('button').button(); However, the first button also submits the form. I would of thought that if it didn't have the type="submit", it wouldn't. Obvi...

Jquery form plugin on IE7

I tried using jquery form plugin on IE7. I wanted to use this specifically http://jquery.malsup.com/form/#html . When I tried it over Chrome/FF it worked. But with IE, it didn't work. I tried changing the form method to GET and it worked on IE. Is there a way I can use the plugin with POST ? Thanks, Anush ...

jquery: how do I serialize file type input in jquery

Hi, I want to serialize file name of the file being uploaded in the input type file , but when I serialized the form in jquery I just got the input type text and others not the file - how do I do it? is it something jquery fails to achieve?? this is the html, [PHP]ask_add_xml.php" method="post" enctype="multipart/form-data" id="form_q...

jQuery keyboard navigation using .live() or .delegate()

Hello, I am currently trying to implement keyboard navigation with jQuery (1.4.2) on a webpage that has all the information getting pulled from a ajax request with Spry. I know it's a convoluted method of grabbing data and populating a webpage with it, but I really like how Spry handles datasets. My markup looks something like this: ...

BIG Resource eater

This script is eating up a lot of resource on my members computers. I have other interval scripts that don't eat up any resource. I've tried extending the time but that slows down the refresh. Any suggestions? <script type="text/javascript"> $('document').ready(function(){ updatestatus(); scrollalert(); }); function updatestatus(){ ...

How to carry "getjson" functionality from one func to another?

Basically I have a getjson call to call for a bunch load of data. Now I am getting sick of the amount of if data is null else checks. For Example: if (data.Height == "") { $('#DataHeight').html('No Data is Available'); } else { $('#DataHeight').html(data.Height); } Reason being ...

Changing HTML DOM element name dynamically

What I'm thinking about is when I remove or add a child element from the DOM, I will change other elements' names through JavaScript or jQuery. For example, I'm going to remove the second text box from a form which have 3 text boxes. They have the names "input-1", "input-2" and "input-3." After removing "input-2," I'm going to rename ...

Check if divs are visible with jQuery

I am attempting a one page design using loads of jQuery. I have a few main navigation elements and depending on which is clicked, different divs are shown or hidden. For example the html: <div class="box a"> <div class="inner"> <a class="boxLink circle black" href="#">Link a</a> </div> </div> <div class="box a1 hidden"> <div class="in...

jquery $.ajax function using a variable URL

var array = new Array(); $.get('comics.txt', function(data) { array = data.split(","); for(var i = 0; i < array.length; i++) { var $page = array[i]; $.ajax({ url: $page, success: function(data) { alert(data); } }); } }); comics.txt is a file whi...

How to call a server side method on losing focus from a textbox, asp.net mvc

I have two textboxes, one isfor 'program' and the other for 'description'. I have a predefined set of programs and it is associated descriptions in the database. Example : For program named 'Test' it has the description as 'Valid' in the DB Table For example, when enter a program name in the program textbox as 'Test', its associated ...

For loop in jQuery

Need to run a for loop in jquery. Condition is : i have the following code <div id="container"> <ul> <li style="background-color:#CCC">First</li> <li style="background-color:#CCC">Second</li> <li style="background-color:#CCC">Third</li> <li style="background-color:#CCC">Fourth</li> <li style="background-color:#999...

Generate UL LI combination dynamically with jquery

Let me brief you the whole requirement first. I have the following HTML code: <div id="container"> <ul> <li style="background-color:#CCC">One</li> <li style="background-color:#CCC">Two</li> <li style="background-color:#CCC">Three</li> <li style="background-color:#CCC">Four</li> <li style="background-color:#999">Fi...

Jquery event for changing an element's class attribute

I need to execute a JQuery code when an element's class attribute is changed. For example, initially the element will be : <div class="my-class">. So, when a new class is added to this div, (i.e. <div class="my-class new-class">, I have to trigger a JQuery code. How do I do this in JQuery? Is there event for attribute change? ...

Protect jQuery function from outside access

I'm using jQuery in an app which registers user clicks to perform a given action through the .click() binding, and I want this functionality to be available only through a user mousedown. One of my friends pointed out today that it's possible to run $(element).click() from a javascript terminal in Firebug (or something similar), and achi...

is there any way to assign variable for css claas name?

I am looking to assign variable names to css class dynamically. Here im explaining with small code #A1, #A2, #A3, #A4{ float: left; clear: left; width: 300px; margin: 15px; } instead of writing " #A1, #A2, #A3, #A4" , i want to write some variable. with for loop i want to define four classes while page is getting loaded. ...

Preserve text selection in contenteditable while interacting with jQuery UI Dialog and text input.

I have a jQuery dialog for making links in a contentEditable span. The problem is that clicking a button to open the dialog causes the selection to be lost, text input inside the dialog also causes the selection to be lost. I can fix the button with -moz-user-select:none; but -webkit-user-select:none doesn't work in Chrome. I can fix t...

Is the downside of coding styles (css) in jQuery genuinely prohibitive?

I was just reading an article about the non-compatibility of some CSS, when it occurred to me that maybe I should be writing all of my CSS in jQuery. Aside from javascript-disabled browsers, which any ajax website isn't going to support anyway, what's the downside? The benefit, aside from greater browser support, would be the use of var...

jquery and .attri doesn't work?

Here is my code: function init(){ $.get(URL, function(data) { DATA = data; var srcWithHead = URL + "/" + $(DATA).find("img").attr("src"); $(DATA).find("img").attr("src", srcWithHead); console.log("src = " + $(DATA).find("img").attr("src")); }); } And I would like to have a picture showing. But the URL image...

How to get the URL strings with subsites/subfolders only

Hello I want to get the current URL using javascript/jquery. The URL should include subfolders/subsites in the path but not the page or any other query parameters. Examples http://test.com/site1/folder/abc/test.aspx Output : http://test.com/site1/folder/abc/ http://test.com/site1/folder/abc/test.aspx?id=1&amp;name=xyz Output : htt...