javascript

Debug multiple Adobe AIR windows in Aptana

I am working on an Adobe AIR project with a login window (first html page) and then a second window for the main application (second html page). I am using javascript for the logic (as opposed to Flex) and read about Aptana´s javascript debugging for AIR applications. Unfortunately I can only get it to debug up to the point the second ...

Is there a javascript compass html widget?

For a project I'm working on, the user needs to enter a direction, like "north" (ie N), NE and so forth. It'd be nice to have a little compass on the webpage that the user could click on various points on the compass and it would represent the appropriate direction. Is there some existing javascript html snippet that does this? ...

is it possible to disable the submit behaviour of a server side button using Javascript

Hi All, is it possible to disable the submit behaviour of a server side button using Javascript? Note: I dont want to disable the button, the user will click the button but it will not submit/get any value from server. scenario: <asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" OnClientClick="Check()" /> ...

Javascript inheritance

Hello I'm trying a few different approaches to Javascript inheritance at the moment. I have the following code: ('borrowed' from http://www.kevlindev.com/tutorials/javascript/inheritance/index.htm) KV = {}; KV.extend = function(subClass, baseClass) { function inheritance() {} inheritance.prototype = baseClass.prototype...

How should I update Mega Menus from Javascript.

I have some "mega menu" style menus on a site I maintain. These are essentially a set of nested <UL>s. Since there are about 150 to 200 entries in the complete menu, it adds a lot of bulk to the page and makes screen readers painful. I plan to change the menus so that only the top level of the menu is output on the page, which will cut ...

Javascript: prototype inheritance

Hello guys, I am new to JavaScript OOP. Can you please explain me what the difference is between the following blocks of code. I tested and both blocks work. What's the best practice and why? First block: function Car(name){ this.Name = name; } Car.prototype.Drive = function(){ document.write("My name is " + this.Name + " and...

How to use a client side database in JavaScript

Possible Duplicate: How to query an XML string via DOM in jQuery DUPLICATE: how-to-query-an-xml-string-via-dom-in-jquery I have an image gallery which uses PHP to look at text files and then show certain images. Now I want to do this in JavaScript instead with no server side requests. I have been working in jQuery. Since I ca...

jQuery - Custom Gallery - Works in FF, Chrome, Safari & IE8, but not IE7 - pointers?

I'm really baffled with the following. When the gallery is created in FF/Chrome etc, clicking next moves the image on one and the hover state remains for you to click again. In IE7, the image moves on one, then the hover state fails, and doesn't reappear. Other effects I have on my page continue to function. My jQuery may not be th...

Facebook Connect Dialog Doesn't Auto Close

I have implemented Facebook Connect into a HTML page exactly as the tutorial explains here http://wiki.developers.facebook.com/index.php/Trying_Out_Facebook_Connect However when after a user has logged in using the Facebook Dialog, the dialog doesn't close, just shows my webpage in the dialog box? Has any experienced the same problem ...

~/ equivalent in javascript

any smart way of doing a "root" based path referencing in javascript just the way we have ~/ in asp.net ? ...

Intense Debate Javascript Chops URL

Intense Debate uses the following javascript code to display a comments number on my blog, which I have included in a handy little php function. By passing this php function the ID of a blog post, it creates a link to the comments section of that specific post. function show_comments_number($id) { $url="index.php?p=post&id=$id"; ?> <sc...

Changing the onclick event delegate of an HTML button?

How do you change the JavaScript that will execute when a form button is clicked? I've tried changing its onClicked and its onclicked child attributes like so: $('mybutton').onClick = 'doSomething'; and $('mybutton').attributes["onclick"] = 'doSomething()'; Neither seem to work. My other options are: To have two buttons and hid...

image above flash element

Hello, I have a flash embedded, it is required for uploading a file and i want to place a image over it. Image1 Shows the expected result: http://i42.tinypic.com/2jcfshv.png but however i dont know how to achieve it, it looks like this: Image2 Shows the actual result rendered by browser: http://i40.tinypic.com/2hnp848.png This ...

JS: body tag onload equivalent?

I need to basically add this to my page: <body onload="document.getElementById('WeddingBandBuilder').focus()"> However due to my template I cannot change the tag. So is there a way to do the equivalent with a script in the < head > tag or something? Thanks! ...

Busy indicator race condition in Javascript

I have the following (javascript/jquery) code to show a busy indicator (after a delay) while an image is loading: function imgUpdate(arg) { var loaded = false; $("#image").one("load", function(){ loaded = true; $("#busyIndicator").hide(); }); setTimeout(function(){ if (!loaded) { $("...

Create event observer for focus?

Is it possible to have focus events bubble in protoype? I am trying to prevent having to assign an observer on every input element. <script language="javascript" type="text/javascript"> document.observe('dom:loaded', function() { // Doesn't work $('editForm').observe('focus', function(evnt){ console.log('FOCUS!'); }); // Works...

Ajax problems in IE/Firefox

Hi I have an ajax script which validates the users information put into textboxes. This is working fine in Internet Explorer, but in FireFox I get an error in getting the gender from a listbox. I have got the gender to be placed into a hidden textbox, for easier processing. The error I get in FF is dd is null [Break on this error] thein...

Why does my AJAX validation code not work properly?

I made a website that depends on PHP, AJAX and Javascript. The problem here is that the website is unstable which means sometimes the validation is working and some times it is not working at all. The validation code is written in JavaScript. Does this mean that we need more special conditions? The code for validation: <script langua...

List of in-browser UI techniques?

I'd like to know what can be done in a browser UI (using a browser+CSS+javascript, not using Flash or Silverlight). For example, I think it's possible to: Drag and drop Arrange list items horizontally, and make them behave like menu items Make things on page visible or invisible, depending on where the mouse is hovering I admit this ...

Prototype and Ajax.Request scope

I'm having trouble getting the correct scope within prototype's Ajax.Request class. What I'm trying to do is write a simple API which wraps ajax requests: API = Class.create({ initialize:function(api_token) { this.api_token = api_token; this.request_uri = new Template('/api/#{api_token}/#{resource}.json'); this.status =...