jquery

jquery autocomplete & masterpage

Hi everyone, first time posting here, so hello to all :-) I'm pretty new to the jQuery thing, but I got the autocomplete function running quite well on a simple aspx page. Now I wanted to use the same function on an aspx-page with a masterpage, and it doesnt work anymore. this test function works fine: $(document).ready(function (...

How do I build a JSON object to send to an AJAX WebService?

After trying to format my JSON data by hand in javascript and failing miserably, I realized there's probably a better way. Here's what the code for the web service method and relevant classes looks like in C#: [WebMethod] public Response ValidateAddress(Request request) { return new test_AddressValidation().GenerateResponse( ...

Change image using jQuery

I have a html-page where used jquery-ui accordion. Now I have to add in this page 2 image which should vary depending on the active section. How can I do it? HTML: <div id="acc"> <h1>Something</h1> <div>Text text text</div> <h1>Something too</h1> <div>Text2 text2 text2</div> </div> <div id="pic"> <img class="change"...

How to switch images with jquery ?

Hi I have a simple setup with one big image container and 3 smaller thumbnail containers. Now when I click on the thumbnail I want to switch the big image and the small thumbnail image, so that the big image container has now the bigger sized thumbnail and the thumbnail container shows the thumbnail view of the before big image. <...

Slight confusion of `this` in a JavaScript call back function

$.ajax({url: path_to_file, cache: false, success: function(html_result){ $("#window_" + this.id + "_cont_buffer").html(html_result);}) Now then. This function call is with in a function of a class. this.id is a property of said class. will this pass the function value of this.id into the string the anonymous function, or will it tr...

Problem Fetching JSON Result with jQuery in Firefox and Chrome (IE8 Works)

I'm attempting to parse JSON using jQuery and I'm running into issues. Using the code below, the data keeps coming back null: <!DOCTYPE html> <html> <head> <title>JSON Test</title> </head> <body> <div id="msg"></div> <script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt; <script> $.ajax({ ...

How Do I Use jQuery/JavaScript To Open A Popup Window/Tab (ASPX Login Page) & Then Pass Values To Opened Window/Tab On DOM Ready Event of Said Window/Tab.

Hi All, We currently have two asp.net 2.x web applications and we need to perform the following functionality: From one application, we want to auto-login to the other web application automatically in a new tab; using the same browser instance/window. So the process is: Open New Window/Tab With Second System URL/Login Page Wait For P...

jquery input-validation (number characters and decimal places).

I have several javascript functions to validate the input data in textbox, so it will limit the user to type into the textbox a range of numbers (eg. from 0 to 500) an x amount of decimals (eg. 1 or 2 or 3 ....). I am having some issues with the javascript functions because they are three separate functions and the alerts get a bit mixe...

How to write browser related script using jQuery?

How do I target different browsers using jQuery? For example the javascript for IE6 and IE7 needs to be different. TIA ...

jQuery Validation Plugin - Using validator.addMethod in Loop

I have a good number of regular expressions used for validation. Instead of manually typing in many addMethods for each regex, I tried using a loop. I have the below simulated struct to hold the regex name, RegExp object and validation message. function RegExs(exprName, expr, exprVM) { this.exprName = exprName; this.expr = exp...

Change background colour of individual elements on the fly

Is there a way in CSS or JQuery where I can dynamically change the background of li tags so they get slightly lighter for each element until it gets to white? For example say I had a list of 10 li elements. The first would have a red (#ff0000) background, the next one would then be a lighter shade of red, and so on and so on until we go...

Show a jquery dialog after a hyperlink has been clicked

Hi, I'd like to show a dialog after the user clicked on a hyperlink. If the user presses continue in the dialog, the browser must go to the hyperlink. If the user presses cancel, the click on the hyperlink should be canceled. The link should have a real url in the href-attribute, the anchor shouldn't be used. How can accomplish this u...

Get users number from iPhone using HTML5/jQuery

Is there a method for getting the iPhone users phone number using HTML5/jQuery? All I see is how to do this with the SDK. EDIT: So far the only thing I've found is on the initial install ask the user for their number and store it. ...

jQuery size() method vs length attribute

Is there any difference between $(".selector").size() and $(".selector").length ? ...

Looped jQuery slideshow with smooth cross-fades

I'm trying to do a simple rotating image on the home page. Under the hood I'm reading a directory and then populating urls for the images into an array. What I want to do is cross-fade the images. If it was just a matter of showing the next one, it's easy, but since I need to cross-fade, it's a bit harder. I think what I want to do is do...

jQuery - if div height over 'x', show only content within the visible div, add an image and scroll up to show full div

Apologies, I'm very new to jQuery. I am trying to apply jQuery to a div which could contain any number of p tags of varying length or none at all. Depending on the assembled p's this div needs to maintain a height of 45px. If the p's contained therein push the div to be higher than 45px then I need to add an anchor image which users ca...

jQuery: labelOver (watermark) sample code

does anybody have a working sample? - thanks ...

jQuery, Hiding elements on ready is always jumping on page load. how can this be avoided?

This is the code. I can't apply display:none; $(document).ready(function() { $("#LeftNav li.navCatHead").not(":first").siblings("li").hide().end().end().first().addClass("open"); }); ...

jQuery sliding panel- multiple links calling different sections of the panel

Hello! I'm trying to design and implement what seems like a simple solution. I have a drop-down panel tab at the top of the page with 3 links in it- about, resume and contact, and an arrow to drop it. I'd like the panel to drop down and show the specific content for the link I clicked on, and swap the arrow to point up to close it. For ...

JQuery: how to use "delegate" instead of "live"?

I've read countless articles how using the JQuery delegate is much more efficient than using the "live" event. As such, I'm having trouble converting my existing Live code to using Delegate. $("#tabs li:eq(0)").live('click',function(){ //...code }); $('#A > div.listing, #B > div.listing, #C > div.listing').live('mouseover',function(){ ...