javascript

Shorten the code for a lot of buttons in Prototype

Hi, I have a lot of buttons and by clicking on different button, different image and text would appear. I can achieve what I want, but the code is just so long and it seems very repetitive. For example: var aaClick = false; $("aa").observe('click', function() { unclick(); $('characterPic').writeAttribute('src',"aa...

Why does ASP.NET cause the "Operation Aborted" Error in IE7?

I have been reading lots of blog posts offering cause and solution to the "Operation Aborted" error in IE. I recently built an application that is getting this error for some of ther users, some of the time. Let me explain in detail. The application is .NET 2.0, ASP .NET and C# web application built in VS 2008. It uses ComponentOne web...

Is it possible to create a "weak reference" in javascript?

Is there any way in javascript to create a "weak reference" to another object? Here is the wiki page describing what a weak reference is. Here is another article that describes them in Java. Can anyone think of a way to implement this behavior in javascript? ...

Javascript and Accessibility

As a web developer, a number of the projects I work on fall under government umbrellas and hence are subject to 508 Accessibility laws, and sometimes W3C accessibility guidelines. To what extent can Javascript be used while still meeting these requirements? Along these lines, to what extent is Javascript, specifically AJAX and using pac...

Javascript form submit: Object doesn't support this property or method (IE7)

Hi I'm trying to submit a form with javascript. Firefox works fine but IE complains that "Object doesn't support this property or method" on the submit line of this function: function submitPGV(formName, action) { var gvString = ""; pgVisibilities.each(function(pair) { gvString += pair.key + ":" + pair.value + ","; ...

Can a Flash movie pass mouse events to the containing page?

One of our newer products is a walk-on video system, in which a character appears in an absolutely positioned DIV and gives a little presentation. We're using Flash 9, AS3. Unfortunately, in order to make him appear in front of the website content, we need to set his Z-index to a value higher than the page content. On some websites and ...

What is the "Operation Aborted" error in Internet Explorer?

I recently added JQuery's date-picker control to a project. In Internet Exploder, I get the following error message: Internet Explorer cannot open the Internet site http://localhost/ Operation aborted What is causing this problem? ...

How do you set the "Visible" property of a ASP.NET control from a Javascript function?

Bascially I want to know the best way to hide/show an ASP.NET control from a Javascript function. I figured I would just access the control in Javascript using: var theControl = document.getElementById("txtEditBox"); Then just set the control's Visible property to true/false. It doesn't seem to be working, I can't seem to figure out...

RESTful URLs, master pages, and PreviousPage woes

I'm am building my asp.net web application using MVC (Preview 5), and am also using the Master pages concept. My PageA and PageB are both content pages. I'm doing a form submit in a method via JavaScript from PageA to PageB. PageB has its PreviousPageType attribute set to PageA, but when I access the PreviousPage property in PageB, ...

Permission denied to get property HTMLDocument.body

I am doing a hidden http post in one page of my application which will login to another application via iframe. In that iframe i am able to access certain functions of that application but however i encounter javascript Permission denied to get property HTMLDocument.body in that application when i try to save and update certain contents...

Understanding Firebug Profiler Output

I've been trying to use Firebug's profiler to better understand the source of some JavaScript performance issues we are seeing, but I'm a little confused by the output. When I profile some code the profiler reports Profile (464.323ms, 26,412 calls). I suspect that the 464.323ms is the sum of the execution time for those 26,412 calls. H...

Javascript: open new page in same window

Is there an easy way to modify this code so that the target URL opens in the SAME window? <a href="javascript:q=(document.location.href);void(open('http://example.com/submit.php?url='+escape(q),'','resizable,location,menubar,toolbar,scrollbars,status'));"&gt;click here</a>`` ...

SOAP - Google Maps and Javascript - Connecting to a webservice

I need to connect to an asmx webservice using javascript. the webservice accepts and returns a soap response. im looking for an example bit of code of how i can connect to the webservice using javascript. it returns lat and long details which i'll then use to plot markers on a google map. i also have the issue of cross domain scripting.....

Is there a way to customize Firebug's keyboard shortcuts?

Is there a way to customize Firebug's keyboard shortcuts? I love being able to step through javascript code using the Firebug console, but it looks like I'm limited to either using the default keyboard shortcuts for stepping over/into/out of code or using the mouse to click the appropriate button. Am I missing something? Is there ...

Execute a JavaScript function in a C# application.

Without using a WebBrowser control, how could I execute a JavaScript function, that is decoupled from any browser DOM dependencies, in a C# application? I am investigating implementing validation rules only once, for both server and client validation. See this question for reference if you like. Are there any JS interpretor libraries ...

asp.net IFrame scroll bar push to top . . .

Heres a tricky one . . I have a webpage (called PageA) that has a header and then simply includes an iframe. Lets call the page within the iframe PageB. PageB simply has a bunch of thumbnails but there are a lot so you have to scroll down on PageA to view them all. When i scroll down to the bottom of the pageB and click on a thumbna...

How to open a new tab and change the current page

<form id="frm_1" name="frm_1" target="_self" method="GET" action="local_page.php" > </form> <form id="tgt_1" name="tgt_1" target="_blank" method="POST" action="http://stackoverflow.com/" > </form> <a onclick="test(event, '1'); " href="#" >Click Here</a> <script> function test(event, id){ document.getElementById("frm_"+id).sub...

Javascript library for building desktop-like web application: ExtJS, jQuery, YahooUI, Mocha, SproutCore, Cappuccino, others?

I am evaluating several Javascript UI toolkits for building web applications that have a desktop-like feel, mainly because of dialogs and window management. I looked at several options - here are my evaluations so far: ExtJS - Great widget library, great docs! Not so great license. jQuery UI - Lack of ready-made window and dialog cont...

Javascript window.open strange behavior in Firefox

Hi, I have a few links that should all open in the same window or tab. To accomplish this I've given the window a name like in this example code: <a href="#" onClick='window.open("http://somesite.com", "mywindow", "");'>link 1</a> <a href="#" onClick='window.open("http://someothersite.com", "mywindow", "");'>link 2</a> This works OK ...

Remove fragment in URL with JavaScript w/out causing page reload

Background: I have an HTML page which lets you expand certain content. As only small portions of the page need to be loaded for such an expansion, it's done via JavaScript, and not by directing to a new URL/ HTML page. However, as a bonus the user is able to permalink to such expanded sections, i.e. send someone else a URL like http://e...