javascript

Setting textbox read only property true using javascript

how to set textbox readonly property true or false using javascript....in asp.net ...

Testing if the element is an array, in Javascript

To check if an element is an array in JavaScript, I have always used Crockford's function (pg 61 of The Good Parts): var is_array = function (value) { return value && typeof value === 'object' && typeof value.length === 'number' && typeof value.splice === 'function' && !(value.propertyIsEnumerable('le...

Why 3 equal symbols in boolean comparisons?

Possible Duplicate: Javascript === vs == : Does it matter which equal operator I use? Why do I see lots of javascript code lately with expressions that look like this: if(val === "something") Why "===" instead of just "=="? What's the difference? When should I use one or the other? ...

How to...Add Client Side function to button that postsback?

I have a button that closes a modal dialog box on an ASP.NET Ajax form. How do a add a client side function to be called on the same button click? currently firebug has this for the onclick javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$DefaultContent$btnPaymentActionDetailClose", "", true, "", "", false, f...

Open Source Calendar Solutions (integrate with Google Calendar)

I'm looking for an open-source javascript solution that would allow me to style a calendar. So far the best I've found has been http://arshaw.com/fullcalendar/ the only problem with this is that it doesn't integrate with multiple Google Calendars. Has anyone seen something that does? ...

Flash uploaders (Uploadify and SwfUpload) - problems with special characters in filenames

I need to implement a flash-based file-uploader, that will allow me to upload multiple files at once and view progress. I tried Uploadify and SwfUpload and it was quite easy getting them to work. However, for both I run into problems, when the users try to upload files, that have filenames with special characters (such as Danish æøå or...

JavaScript Syntax: Inline Ifs in String Assignment Statements

I came across this recently and thought it would make a great SO question. Suppose you are assigning a string to a local variable and you want to vary it by a simple condition. So you insert an inline if statement into the string: var someCondition = true; var url = "beginning-" + (someCondition)?('middle'):('other_middle') + "-end"; ...

Converting from prototype to jQuery - javascript / ajax

I'm looking for some help converting this from prototype to jQuery. I'm doing some free work for a charity and updating a system they use to track and assign volunteers. I've managed to convert everything else so far, however, this has me stumped. Please excuse the spelling mistakes, the code is verbatim what I've been given. I've had ...

find out if iframe url has been changed

Hi, Is there a way for me to find out if the URL in my iframe has been changed, ie, the user has navigated somewhere? Thanks. ...

detect variable change in javascript

Hi! Is it possible to have an event that fires when the value of a certain variable changes? Thanks! ...

Prototype Ajax.Request only calling the last callback

Hi all, I'm writing a userscript for a website that uses Prototype. Rather than use the GM libs (mainly so I can easily repurpose it for Chrome), I decided to use the already-loaded Prototype functions. I'm iterating through the rows of a table, each signifying a unique user, by checking for an online status element on their profile pa...

Override default behaviour for link ('a') objects in Javascript

Hi, I don't know if what I'm trying to accomplish is possible at all. I would like to override the default behaviour for all the anchor objects ('a' tag) for a given HTML page. I know I can loop through all the 'a' elements and dynamically add an 'onclick' call to each one of them from the body element 'onload' method, but I'm looking f...

I found this "[\\?&]v=([^&#]*)" on the internet can someone explain it to me.

I found a method on the internet that can retrieve the Id of a youtube video from the url. this is it. var vid; var results; results = url.match("[\\? vid = ( results === null ) ? url : results[1]; The Id will be contained in "vid". What I don't understand and I find interesting and want to know is this. results = url.match("[\\?...

How to validate PDF form?

I have a writeable PDF form made in Acrobat Professional. I want to validate that a numerical entry is in a certain range [a,b]. If it is not, I want an alert to pop up with the message, "Please contact Larry at XXX-XXX-XXXX to get your form processed." Can someone write up a quick snippet of code that does this for a PDF? I know how to ...

I am having trouble learning javascript. Any suggestions?

I've been trying to learn javascript for 5 years now. I know the basics and can sort of read most javascript that someone else has written but I for some reason still, after 5 years cannot learn this language. My brain just will not let this stuff sink in. I am asked to write javascript from scratch at my new job and they are willing ...

gwt request (via RequestBuilder) causing response to be treated as JavaScript

The following code RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode("http://localhost:8080/xxxx/yyyy")); try { Request request = builder.sendRequest(null, new RequestCallback() { public void onError(Request request, Throwable exception) { } public void onResponseReceived(Req...

Reference outside object in ajax callback function

A simplified example: // Let's create a new object function MyObject() { // } // Add some method to this object MyObject.prototype.myFunctionA = function() { // } // Another method MyObject.prototype.myFunctionB = function(arg) { // AJAX GET request $.get('script.php', { par : arg }, function(data) { ...

Which way is better to define JavaScript regular expressions?

Is it better to use the RegExp object or the inline style? And why? ...

Javascript - if statement not working?

I'm trying to set a class to active depending on the url. I'm trying to use the code below, but in every case, it activates the active class for the second tab. var pathname = window.location.pathname; if(pathname = '/learn/subsection2') { $("ul.tabs li:eq(1)").addClass("active").show(); //Activate second tab ...

How do I get the title of a youtube video if I have the Video Id?

I'm playing now with the Youtube API and I began a small project (for fun). The problem Is that I cant find the way to get Title of a video from the Id. (example: ylLzyHk54Z0) I have looked in the DATA and PLAYER api documentation and I cannot find it. If someone knows how to do this or if someone could help me find the way to do this...