javascript

How to get TextArea contents without error in IE?

I am using jQuery, and I get the contents of a TextArea as follows: // get the SQL from the text area at the top: //sql = $("#sql").val(); //sql = $("#sql").text(); sql = $("#sql").attr("value"); <textarea id="sql" rows="9" cols="99"></textarea> This works fine in all browsers except IE I have tried several ways, but nothing works i...

How do I launch an .exe file on page load to save or run?

I have this lead generation form and after they give us their information, I would like the form's thank you page to popup a window where the user can save the file or open it. This web page will be served from a Microsoft server so .net C# or javascript are options. thx ...

Getting a Javascript error in IE7 but not in Firefox

Okay, so I'm writing some Javascript for a simple effect: when a drop down gets selected, a series of options will appear, depending on which one is chosen. This works great in Firefox, but when I went to test it on Internet Explorere, things weren't so pretty. It failed with, what is oh so helpful, and unknown runtime error. So, here is...

How do I Convert a String into an Integer in JavaScript?

How do I convert a string into an integer in JavaScript? Is it possible to do this automatically, or do I have to write a subroutine to do it manually? ...

Can I detect when a user gets to a page using the back button?

Edit: What I really need to know is if there is any javascript event that will reliably fire when the user arrives at the page via the back button. I tried the onload event for the body element, but it doesn't fire on Firefox or Safari. I'm working with some old code that tries to prevent double-submission of form data by disabling ...

How would you code this: The SO Menu

I'm a person that learns best from example. Currently, I'm diving into the field of Web Development after fifteen years of developing desktop apps. I'm still getting used to all the web technologies used for developing modern web sites and everywhere I look, I see cool little UI elements and question how they're implemented. So I thought...

Hand cursor over a link not showed in IE but it is in FireFox

I have a link within a div: <div> <a href="#"></a> </div> This div make's a box, like a button, and when i mouseover it in Internet Explorer 8 works fine showing the hand cursor, but in firefox doesn't. Can some body help me. Thanks. ...

What are the best practices for making the CSS and JS of a web page cross-browser compatible?

It's always a big problem for web designers to make their page look good in all the commonly used browsers. What are the best ways to deal with this fact? ...

Which popular libraries for a standalone JavaScript interpreter (jslibs) ?

I am working on a standalone JavaScript development runtime environment for using JavaScript as a general-purpose scripting language. Currently I support the following libraries: zlib, SQLite, FastCGI, NSPR (Netscape Portable Runtime), ODE (Open Dynamics Engine), libpng, libjpeg, librsvg, freetype, librsvg, SDL, libiconv, OpenGL, OpenAL...

How can you find the height of text on an HTML canvas?

The spec has a context.measureText(text) function that will tell you how much width it would require to print that text, but I can't find a way to find out how tall it is. I know it's based on the font, but I don't know to convert a font string to a text height. ...

javascript global variable question

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps JavaScript API Example: Simple Streetview Examp...

How do I detect, via javascript in Safari Mobile, if my iPhone application is installed?

As you probably know, iPhone applications can register a custom URL scheme handler, ala "myapp:" and these can be used for links in a page viewed in Safari. I'd like to automatically launch my application from a specific page if the visitor has the app installed. If the app's not installed, I'll just show them the current mobile-optimi...

Swap image src with jQuery Ajax request

I have an <img src="..." /> tag with a default src set. I'd like to have jQuery make an ajax request to get another image and when this new image is fully loaded, set the src of the <img ... /> tag so there's no flicker. I'd prefer not to do any of the preloaders like new Image().src="foo" etc. I'd really like the iamges to load on an aj...

How may I sort a list alphabetically using jQuery?

I'm a bit out of my depth here and I'm hoping this is actually possible. I'd like to be able to call a function that would sort all the items in my list alphabetically. I've been looking through the jQuery UI for sorting but that doesn't seem to be it. Any thoughts? ...

ASP.NET javascript debugging does not work in 2 projects

Hi, I have 2 asp.net web applications, one of which is the main application and the second one is referencing the first application for like master pages , themes etc, and the main frameset that will point to the second application's webform based on database values (menu generated from database); All my actual forms are in the second ...

document.location - Not adding to history

heya, I'm attempting to use document.location(.href) on the onLoad event to redirect from one page (A) to another (B). From my understanding, if I use document.location.href (as opposed to .replace), it should add (A) to my history. However, this doesn't appear to be happening. I've tried setting document.location, document.location....

OnClick vs OnClientClick for an asp:CheckBox?

Does anyone know why a client-side javascript handler for asp:CheckBox needs to be an OnClick="" attribute rather than an OnClientClick="" attribute, as for asp:Button? For example, this works: <asp:CheckBox runat="server" OnClick="alert(this.checked);" /> and this doesn't (no error): <asp:CheckBox runat="server" OnClientClick="ale...

Problem with my variable scope in JavaScript I think

I have quickly coded up a sort of product display thing that gets half of it's input from the page, and the other half from an AJAX query. Here is the code function productDisplay() { products = []; this.index = 0; setupProductDisplay(); processListItems(); showProduct(); function setupProductDisplay() { ...

Floating Menu to stop before it hits the bottom of the page

I have a floating menu(absolutely positioned) that stays in view as the user scrolls down the page, the problem is i have quite a large footer and if you scroll all the way to the bottom of the page it will clash with the footer. I just want to make it stop say 400px from the bottom of the page.. Does anyone know if this can be done? H...

silverlight 3.0 communication with winforms

I would like to create a winform on the client side for interaction with Silverlight 3.0. The basic idea is using the winform browser. I definitely need both the directions of communication. Would it be impossible by using JavaScript as a midware for the interaction or some better ways? Or is there any new features of Silverlight 3.0 sup...