jquery

Problem with Json Date format when calling cross-domain proxy

I am using a proxy service to allow my client side javascript to talk to a service on another domain The proxy is a simple ashx file with simply gets the request and forwards it onto the service on the other domain : using (var sr = new System.IO.StreamReader(context.Request.InputStream)) { requestData = sr....

click .toggle add/remove class

When i click #tool I want to add the class .spanner to the div #drill. However when #drill has the class .spanner and #tool is clicked i want the class to be removed? ...

a href nested in DIV element in ASP.NET C#

Hello all, My question is quite simple, I created a DIV, with a HyperLink control in it. As following: <div id="divOne" style="width: 500px;"> <asp:HyperLink runat="server" id="hlOne" Text="hlOne" NavigateUrl="http://www.StackOverflow.com" /> </div> I created an onclick event in jQuery for the DIV as well: $('#divOne').c...

Using XSL transformations with jQuery

Does jQuery support XSL transformations of XML? If so how do I use it? I have bespoke code that does this, but would rather use jQuery if possible. ...

pop-up as value is entered in text box using jquery

Hello, When the value is entered, I want an alert, its a copy/paste text box, using jquery ('#test).bind('onblur',function(){ var h = ('#test).attr('value'); alert(h); }); <input type=text id=test> Thanks Jean ...

jQuery .next() and .prev() not working as they should!

I want to get the .next() and .prev() sibling of an HTML element without excluding TextNodes. I basically need to understand if an element is directly sorrounded by <br> HTML elements. This would return true: <br> <div></div> <br> This would return false: <br> Some text <div></div> <br> BUT this needs to also return true: <br> ...

jQuery Form plugin - no data from file upload?

I've been struggling a bit with the jQuery Form plugin. I want to create a file upload form that posts the data (JSON, from the chosen file) into a REST service exposed by a servlet. The URL for the POST is calculated from what the user chooses in a SELECT dropdown. When the upload is complete, I want to notify the user immediately, AJAX...

jquery animate - dead simple

All I want to do is on .click() is .animate #slip, essentially Im changing the css at the moment from top: 10px to top: 0px Instead of it being quite clunky i'd like to animate the movement on the change of CSS. Currently use .toggleClass to achieve this: $("#div1").click(function() { $("#div2t").toggleClass('min'); })...

The best way to do :not in jQuery?

Hi, I have a menu in jQuery when you click on a link it opens up, but I want it so when you click somewhere else, anywhere else that is not the menu, it becomes hidden. At the moment I'm binding a click event to $(':not(#the_menu)') But this seems like I'm binding a click event to the entire minus the menu, is there a more efficie...

How to set focus to a textbox on page load event

I am trying to set focus to the text box on page load event. I tried many solutions by referring the element id, but couldn't able to focus the element. Later when I inspect the element using firebug I found for the same element the id changes in different execution. I am looking for the simplest solution using javascript or jquery to ac...

How to add string to jQuery selector?

I'm trying to select an id that changes on different posts of same page. So the they have been given an id="show_posts_{PostID}" - on the final output the {PostID} is replaced with a number. In the function I need to call $('show_posts_XXXXXX') - XXXXXX being the generated ID. I have stored this ID in a variable called postId. But I ca...

how do i change the value of an input field with jquery?

Hi, i'm trying to use jquery to change the value of an input text box, but it's not working, here is my code... <form method="get"> <input id="temp" type="text" name="here" value="temp value" /> <input class="form" type="radio" value="1" name="someForm" /> Enter something Here: <input id="input" t...

Whats wrong with this function

I cant work out which brackets are in the wrong place and where and now im completely lost: $("#slid").click(function() { $("#div1").animate({ top: "25px",}, 300 },function() { $("#div1").animate({ top: "85px",}, 300 }); }); Can anyone help? ...

jQuery change method on input type="file"

I'm trying to embrace jQuery 100% with it's simple and elegant API but I've run into an inconsistency between the API and straight-up HTML that I can't quite figure out. I have an AJAX file uploader script (which functions correctly) that I want to run each time the file input value changes. Here's my working code: <input type="file" ...

'$.fn' is null or not an object

Problem 1 Error: Microsoft JScript runtime error: '$.fn' is null or not an object Error area: $.fn.apply=function(item,content,header){ $(".featureBox"+item).css('z-index', "1000"); $("img.featureBox" + item +"top").attr("src",basepath + "box-big-top.jpg"); $("img.featureBox" + item +"imgcut").attr("src",b...

Jquery/Ajax Refresh without reload or load the page?

I have a report page which dynamically generate the record and saved in the database. From database i need to show the dynamically updated records in the page without reload or load the contents using setInterval time function. ...

Jquery AutoComplete Load Problem

Hi all; Not Work Jquery Code: $('[id$=Name]').autocomplete('CallBack.aspx',{formatItem: function(item){return item.Name;}}).result(function(event, item) { location.href = item.AGE; }); Json: var data = [{NAME:"John",AGE:"57"}]; Work Jquery Code: var data = [{NAME:"John",AGE:"57"}]; $('[id$=Name]').autoco...

switching default keyevents actions after key combinations

I need to change default actions of two events. When I press "enter" one action occurs, when I press "shift-enter" another. I need to switch it. I means if I press "enter" than "shift-enter" action occurs. I tried something like this but if doesn't work. f(evt.keyCode == 13) { if(!evt.shiftKey){ evt.preventDefault(); ...

Custom Validation on jquery validate plugin, need to count element in a multiple select

I have a multiple select, and I need to force the user to choose maximum two options, nothing more. I'm trying this: jQuery.validator.addMethod("morethantwo", function(value, element) { var foo = []; $(element+' :selected').each(function(i, selected){ foo[i] = $(selected).text(); alert(foo[...

Name validation using jquery validation framework

I want to add a custom function using jquery validation framework, to help validating names (first name and last name) inside a form. I understand I could just eliminate numbers... but wondering if there is a 'best practice' way using jquery validation framework, somebody could suggest me...? Thanks ...