javascript

Focus behavior in Applet-Javascript interaction

I have a web page with an applet that opens a popup window and also makes Javascript calls. When that Javascript call results in a focus() call on an HTML input, that causes the browser window to push itself in front of the applet window. But only on certain browsers, namely MSIE. On Firefox the applet window remains on top. How can I ke...

SOLVED: What is the OO approach to accessing jQuery plugin methods from my plugin HTML?

I started with this question: http://stackoverflow.com/questions/1875693/multiple-javascript-gadgets-per-page . After reading up on how to build a jQuery plugin I've modified my OO JavaScript object into a jQuery plugin by wrapping my JS object in (function {} { /*my object code*/ }(jQuery)) and adding a function createMyGadget() {...

modern windowless popups

Hello all, I have seen for some time popups without window and it looks like a custom made png file as popup. many times there is a big close cross in the upper right corner. Can someone tell me please how this is called and in what kind of code this is made? ...

Cufon font replacement: How can I eliminate the flash of unstyled text that occurs when the page loads?

I'm using Cufon to replace the font of selected heading elements on a site I'm working on, but whenever I load a page, there is a noticeable flash of unstyled text before Cufon replaces the text. I expect that I may be doing it wrong. Here's what I have in the <head>: <script src="/js/Monotype_Corsiva_italic_400.font.js"></script> <scri...

How to make child-navigation not affect parent browser history ?

I have a main page which contains a simple iframe. Iframe source = a php file. The PHP have a link the user can click, but whenever clicked, the browser history increases. I want the iframe to be independent, without affecting history. Possible? I am not familiar with ajax btw. PS: Its only 1 link in the iframe which can be clicked. T...

NetBeans: Specifying html for Applet which uses JSObject for debugging

I would like to specify html for my applet and debug it in NetBeans. The helpful is following: My applet class is MainApplet. I put MainClass.html in the same folder with MainApplet.java. After this I run applet via right click on file in NetBeans and selecting Debug "MainApplet.java". It looks like applet tag from MainApplet.html is us...

window.onload/onunload and <body onload/onunload >

I have read the thread window.onload vs <body onload=""/>. In that thread, many claim that window.onload and body onload="" are identical. This is not what I experience. Consider the two test pages: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="...

Calling a function by a string in JavaScript and staying in scope

Hi, I've been playing around and searching a bit, but I can't figure this out. I have a pseudo private function within a JavaScript object that needs to get called via eval (because the name of the function is built dynamically). However, the function is hidden from the global scope by a closure and I cannot figure out how to reference i...

What is node.js?

I don't fully get what node.js is all about. Maybe it's because I am mainly a web based business app developer. Can someone please explain what it is and the use of it? Thanks. My understanding so far is that: The programming model is event driven, especially the way it handles IO. It uses javascript and the parser is V8. It can be ea...

opening a link in <body onload=""

I guess this is possible, but I don't know how. <a rel="width[640];height[480];autostart[true];loop[true];title[Google]" class="jcepopup" href="http://www.google.nl"&gt;Aanbieding&lt;/a&gt; Can it be done linke this? <body onload="javascript: laden()"> <script type="text/javascript"> function laden() { window.open('http://...

Filling out and submitting a form for a newly opened window

What I'd like to do is open a new window, then submit the form in that new window after automatically filling out he form elements from the original window. Here is what I tried to do: var username = 'myuser'; var password = 'mypass'; var loginWindow = window.open('http://www.mysite.com/form.html', 'loginWindow'); loginWindow.document.g...

Iterating through table rows in nested divs

I have a page that contains a couple of layers of nested div tags. Within the the 8 or 9 of the divs are tables. How do I iterate through the divs and pick the specific divs that I want and then iterate through the cells in the table (one row) embedded in each of the divs? Here is a representative sample of the page that I want to ite...

Dynamic function call (apply)

I am trying to dynamically call a function inside of an object. Found the apply function but not fully understanding it. Check out the code below, by triggering Test.checkQueue() it should in turn call showSomething "method". Thanks. var Test = { , queue : [{action:'showSomething', id:'1234'},{action:'showOther', id:'456'}] , showSom...

Force spell check on a textarea in WebKit

I'm creating a browser based QC/data entry app that will let people edit OCRed files, which naturally have tons of errors. Chunks of data are put in textareas so they can be checked, but the red underlines only appear when the user manually puts the cursor in a misspelled word. Is there a way to force WebKit to add the little red spell ...

Basic modal code login intergrated in Joomla login form

Hi, I have found a nice code for a basic-modal login dialog. I also have a Joomla website which I'd like to have the basic modal code intergrated to. For a example, please click the link beneath and choose the "login dialog box" link Login Dialog Box This is the HTML Part <!-- #dialog is the id of a DIV defined in the code below -->...

New Quicktime Look for Embedded mp3s

Hi there, With the release of Snow Leopard, Apple has also unveiled a newer, slicker looking version of the quicktime controls for when html links to an mp3. I'm working on a site with embedded mp3s, and would like them to show up inside Quicktime's newer skin, but I can't figure out how to do it. Everything I've tried results in the sa...

Determine if an iframe is visible on the screen

Hello! I have an iframe that is being loaded into external sites of which I cannot put any code in. What I would like to be able to determine from within my iframe (different domain) is if the iframe is currently within the 'viewport' of the browser (or if it is scrolled off the page). Is there any way for this to be done? As I do not ...

In Javascript, how to avoid NaN when adding arrays

I'm trying to add the values of two arrays in javascript eg. [1,2,1] + [3,2,3,4] The answer should be 4,4,4,4 but I'm either getting 4,4,4 or 4,4,4,NaN if I change the 1st array length to 4. I know a 4th number needs to be in the 1st array, but i can't figure out how to tell javascript to make it 0 rather then undefined if there i...

Best way to post files asynchronously with ExtJS

Hi, I basically have a form that the users filled in, and in which it's also possible to attach files. It's really equivalent to gmail actually: the files are sent while you're still typing the information in the form, and when you click on the final submit button, it waits for the files to be all transferred and submit the final fields...

Strange behavior in Javascript enhanced for...in loop

I am making a Javascript game with the canvas tag, and I am using an enhanced for loop to update the player positions. In brief: var actors = new Array(); var player = new Actor(0, 0, img); actors[0] = player; function update_positions() { //position 1 for(var a in actors) { //position2 a.xpos += a.xvel; ...