javascript

I want to disable controls inside the Silverlight usercontrol from an event inside the asp.net usercontrol

Hey, I have an ASP.NET usercontrol inside which I am enbedding the Silverlight usercontrol. I have two events in the asp.net usercontrol - EDit and View . In the view mode I want all the controls on the Silverlight side to be disabled . So, How can I disable the controls from my asp.net code. Thanks ...

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( ...

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...

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 ...

Why does my submit button fail to trigger Javascript MVC?

I have a simple code from a book and the code should display data from my controller in the "results" span. What am I missing? Controller... public string GetQuote(string symbol) { if (symbol.Trim() != "") return "99"; else return "Sorry"; } ASPX... <%@ Page Title="" Language="C#"...

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...

In JavaScript, How to convert string into Date ? Where string may have different culture format.

Hi I am getting DateString in JavaScript from the TextBox like, var dateString = document.getElementById('<%= txtEffDate.ClientID %>').value; dateString value may be in following format. en-US -> "4/29/2010" fr-FR -> "29/04/2010" de-DE -> "29.04.2010" it-IT -> "29/04/2010" es-ES -> "29/04/2010" zh-CN -> "2010/4/29" ja-JP ->...

what does this javascript code do?

Found this code in our code base the other day. Not sure what it is used for. Any guesses? function checkIntegerRange(x) { return ((x >= 0) && (x < 2020202020)) || (x == 2147483647) || (x == 4294967295); } ...

Javascript - innerHTML not working with HTML select menus

Hi guys, In my HTML page I have 2 select menus with IDs "month" and "day" - "day" is empty when the page loads, "month" has 12 options with values 1-12 corresponding to January - December. "month" has an onchange event which calls this function: function showOutboundDays(month) { if(month==4 || month==6 || month==9 || month==11) do...

swfupload - get image dimensions

First of all congrats to everyone for a great job. swfupload is a very good and quality tool. My question would be, is there any method in the script to check the dimensions of the image and if the dimensions are not correct display warning popup and not save the image. Thanks in advance. ...

Using a variable as identifier in a json array

Hi folks! I'm wondering if it is possible to use assigned variables as identifier in a json array. When I tried this, I was getting some unexpected results: (Code is simplified, parameters are passed in a different way) var parameter = 'animal'; var value = 'pony'; Util.urlAppendParameters (url, {parameter : value}); Util.urlAppe...

How to disable Cufon on certain elements?

Hiya, I currently use Cufon accross our site with something similar to Cufon.set('fontFamily', 'DIN Medium').replace('h1'); Now for a single H1 tag i would like Cufon to be disabled, this is without changing the H1 tag to any other tag, it must remain as it is. I can add classes etc to the H1 tag if required, and can do any HTML/CSS/JS...

Clear a kml that was added to google earth using javascript

I have added a kml to google earth by use of button with javascript. How can I delete that kml or clear all kml's by use of another button? thanks ...

When is case sensitivity important in JSON requests to ASP.NET web services (ASMX)?

I've done the following tests with JSON requests sent to an ASP.NET 2.0 ASMX web service (using AJAX Extensions 1.0 for ASP.NET 2.0) and it seems that case sensitivity is important in some situations but not in others. See the following examples: Case matches 100%: {"request":{"Address":{"Address1":"123 Main Street","Address2":"suite...

How to call postback using javascript on ASP.NET form

I have a web form with textbox and button. I want after "ENTER" key click on textbox postbak form. I am using next code: onkeypress=" if(event.keyCode==13) { alert(2); WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('ctl00$ContentPlaceHolder1$btnSearch', '', true, '', '', false, false)); alert(2); return false;} where Web...

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...

Rails3 renders a js.erb template with a text/html content-type instead of text/javascript

Hi, I'm building a new app with 3.0.0.beta3. I simply try to render a js.erb template to an Ajax request for the following action (in publications_controller.rb): def get_pubmed_data entry = Bio::PubMed.query(params[:pmid])# searches PubMed and get entry @publication = Bio::MEDLINE.new(entry) # creates Bio::MEDLINE object from e...

Flip numbers in a string

I have an issue with some Arabic text where I need to flip numbers inside a string. So this: "Some text written in 1982 by someone with m0123456 or 12-to-13" Should become: "Some text written in 2891 by someone with m6543210 or 21-to-31" A regex solution will be great. The more optimized for large strings the better. Any hints? ...