javascript

Mad-Scientist Javascript Obfuscation Idea

Hey guys, So I'm sure this is probably at least mostly insane, but I was just thinking about AS3/JS interaction and it got me wondering - does anyone know exactly how inefficient calling JS via AS3 is? For example, if you do the following: import flash.external.ExternalInterface; ExternalInterface.call("(function() { /* here's a block...

is there any JavaScript interpretor that can handle very large numbers?

Possible Duplicates: Is there a bignum library for JavaScript? Strange syntax of Number methods in JavaScript I just wrote some code to figure out a Project Euler question. I kept getting... Uncaught SyntaxError: Unexpected token ILLEGAL I couldn't see the syntax error in my code... The number I'm using is 1000 digi...

Strip brackets and the word "The" from a string

I have been trying to figure out regex myself and to no avail can I get the last bracket to disappear from a string. For example: [The Day the Earth Stood Still] I can only get: Day the Earth Stood Still] with the following RegEx code: /(\[|\](^The ))\2/ I'm aiming for just: Day the Earth Stood Still Any help would be greatly a...

JavaScript Plug In for Visual Studio?

I am working on an ASP.NET project, and it is very frustrating how poor the support for JavaScript is in VS. For example, no outlining, no f12 to find a definition, no refactoring, no code analysis, no ready support for documenting functions, horrible navigation and barely functional intelisense. Although JavaScript is no doubt an intra...

JavaScript validate existance of date

Hello! I have a date in the format YYMMDD. Is there anyway I can validate it in JavaScript? By validation I don't mean easier things like length, characters etc but rather if the date exists in real life. I'm hoping there is a faster / better way than breaking it in 3 chunks of 2 characters and checking each individually. Thank you. ...

How can I add multiple sources to an HTML5 audio tag, programmatically?

A lot of examples demonstrate multiple source tags nested in the audio tag, as a method to overcome codec compatibility across different browsers. Something like this - <audio controls="controls"> <source src="song.ogg" type="audio/ogg" /> <source src="song.mp3" type="audio/mpeg" /> Your browser does not support the audio element....

JQuery missing : after property ID

So I am working with some jquery code to do a simple hide of a p and a show of a p. I am simple adding a class called showp and showing it while making sure the others are not shown by hiding them first. But I keep getting an error missing : after property ID. Any help would be greatly appreciated. $(document).ready({ $("#phone"...

How is the Pop up alert which is displayed on stackoverflow when you are answering a question and someone submits another answer created?

Ok, so you know when you're answering a question and are in the middle of typing it, and someone else posts an answer to your question and you get a little popup that says there is a new answer to the question? My question is how do you do that? I think I have the basic concept down... A question is answered, added to the database. The p...

jquery - find first previous node with certain properties

regardless of parent/child-relations etc, how do I find the node closest above $(this) node with a certain property, for example class="field"? ...

How do I make an ASP.Net GridView postback on an onBlur event?

I have an ASP.Net GridView, with two columns ("ID" and "name"). The name column is editable via an <asp:TextBox>. What I want to do is have the grid trigger its update event when the user clicks away from an editable cell. I know I can attach an onBlur event handler to the TextBox to retrieve the value when the user clicks away. Ho...

CSS single select list example

I am looking for a click based single select list. Instead of the normal drop down list, I want an overlay menu (similar to how we see on facebook when we change privacy settings, the single select list that appears). Is that CSS based or any code examples to creating a similar list? All the lists i found of the net are hover lists not s...

In JavaScript - after I open a window using window.open - can I resize its dimensions at will?

I realize that most browsers block window resizing but was wondering that since I am the parents of this newly opened window, would I have any priveleges over sizing it not just on the Open but after? I am not trying to annoy users either :) I specifically need to keep 2 windows in sync (Same size). thanks! ...

How to set an ID on the target of an HTML form

I need to set a window.id on the target of an HTML form. The motivation is for Selenium automation tests. How would I access this window? ...

change cursor to busy while page is loading

I understand how to use javascript to change the cursor to busy while the page is making and ajax call. However I have a page that does not use ajax, it uses a postback to reload the page. However the load is rather data intensive and it takes a few seconds. During this time the user can still click on the page. I want to turn the curs...

How to return post results through function?

I am calling a function that returns the result of an ajax GET request using jQuery. How do you return its result through the function to the callee? function makePrPoContent(s_firstName, s_lastName, s_email){ $.get('/includes/snippets/privacy_policy.jsp', { firstName: s_firstName, lastName: s_lastName, email: s_e...

Opening External Application within Adobe Air App using JavaScript

I'm working on a personal Adobe Air Application that will hold a lot of required elements for my job including important web links to various places I may need. But I have ran into a bit of an issue... I need to have a couple of buttons that will open external applications (like ThunderBird and Spark). I'm aware that you can do this wit...

How to dynamically piece page elements together to form a square?

I have a number of items with different values. I'd like to represent each item as a square with its size corresponding to its value, where each square is a component of a larger square. All the squares of different sizes fit together to make a larger, perfect square. Is it possible to do something like this with HTML/CSS? Does anyone k...

How to use setInterval or setTimeout with a for loop?

I am trying to set an interval when some code runs but only need to do it based on the number of elements there are. Here's a quick example: 5 total elements Run code once every 20 seconds for each element that is found. Can someone please give me a basic example how to do this using plain JavaScript? Everything I have tried just exec...

TinyMCE Skins, Better than the

Hi! Are there better looking TinyMCE skins except the one of http://thebigreason.com/ and http://www.cirkuit.net/projects/tinymce/cirkuitSkin/? I couldn't find one that has: buttons for ALL features a nice layout ...

How to update DIV content in Firefox using Javascript?

Hi I have this code in javascript to show time in div and update it: if (!document.all) return var Digital=new Date() var hours=Digital.getHours() var minutes=Digital.getMinutes() var seconds=Digital.getSeconds() var dn="AM" if (hours>12){ dn="PM" hours=hours-12 } if (hours==0) hours=12 if (minutes...