javascript

JavaScript interactive shell with completion

For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online JavaScript Shell is really nice, but I'm looking for something local, without the need for an browser. So far I have tested the standalone JavaScript interpreter rhino, spidermonkey and goog...

Generating JavaScript stubs from WSDL

Hello, I'm looking for a tool to generate a JavaScript stub from a WSDL. Although I usually prefer to use REST services with JSON or XML, there are some tools I am currently integrating that works only using SOAP. I already created a first version of the client in JavaScript but I'm parsing the SOAP envelope by hand and I doubt that my...

jquery tablesorter plugin

Im using the tablesorter plugin ( http://tablesorter.com ) and am having a problem with column widths in IE7, it looks fine in firefox and sometimes in IE7. here's a screenshot of the problem: IE7 View and here's how it's supposed to look: Firefox view ...

JavaScript IDEs

Yay, another "What is the Best IDE"-Question, but this time it's for a language that does not seem to have any really popular yet: JavaScript. With an IDE, I mean the full set: Writing Code with Syntax Highlighting and possibly "IntelliSense" Code Completion Helper, but also debugging including Breakpoint and Watches (also for AJAX Stuf...

LightWindow & IE7, "Line 444 - object does not support this property or method"

I have just received and bypassed a problem with LightWindow and IE7 where, on page load, it throws a JavaScript error on line 444 of lightwindow.js, claiming that the "object does not support this property or method". Despite finding various postings on various forums, no Google result I could find had a solution, so I am posting this ...

How do I get the difference between two Dates in JavaScript?

I'm creating an application which lets you define events with a time frame. I want to automatically fill in the end date when the user selects or changes the start date. I can't quite figure out, however, how to get the difference between the two times, and then how to create a new end Date using that difference. ...

Are semicolons needed after an object literal assignment in JavaScript?

The following code illustrates an object literal being assigned, but with no semicolon afterwards: var literal = { say: function(msg) { alert(msg); } } literal.say("hello world!"); This appears to be legal, and doesn't issue a warning (at least in FireFox 3). Is this completely legal, or is there a strict version of JavaScript wh...

How do you pause before fading an element out using jQuery?

I would like to flash a success message on my page. I am using the jQuery fadeOut method to fade and then remove the element. I can increase the duration to make it last longer, however this looks strange. What I would like to happen is have the element be displayed for five seconds, then fade quickly, and finally be removed. How can ...

Real image width with Javascript

I have the next function: function setImagesWidth(id,width) { var images = document.getElementById(id).getElementsByTagName("img"); for(var i = 0; i < images.length;i++) { // If the real width is bigger than width parameter images[i].style.width=width; //} } } I would like to set the css width attribu...

Metalanaguage to describe the Model from MVC to generate identical client and server side code

I am looking for a powerful meta-language to describa behaviour for an application i intend to use in offline mode (google-gears + javascript) and server side sqlite + (php/ruby/java etc) and looking for a good format to describe the model's behaviour which can be easily converted to the target languages. Am I completely off track, and t...

How do I reference a javascript file?

I'm working on a C#/ASP.NET project that has all the javascript files in a /Javascript folder. If I refer to the JS file using this syntax: src="/Javascript/jsfile.js" then the file is correctly picked up if the project is deployed to the root of the URL. However, if this "web site" is deployed to a sub-folder of the main url this won't...

How do I serialize a DOM to XML text, using JavaScript, in a cross browser way?

I have an XML object (loaded using XMLHTTPRequest's responseXML). I have modified the object (using jQuery) and would like to store it as text in a string. There is apparently a simple way to do it in Firefox et al: var xmlString = new XMLSerializer().serializeToString( doc ); (from rosettacode ) But how does one do it in IE6 and o...

How do I make the jquery dialog work with the themeroller themes?

Hello, I am trying out the dialog from jquery ui. All the online demos use flora.css. I can't the dialog to display correctly with the css file generated by the themeroller application. Am I missing something? shouldn't these things work out of the box? Update: Thanks, Brock. When I cleaned up my code to make a sample, I realized that ...

Max length for html text areas

What's the best (cross browser) way of restricting the maximum number of characters that can be entered into an html textarea? ...

"undefined handler" from prototype.js line 3877

A very niche problem: I sometimes (30% of the time) get an 'undefined handler' javascript error on line 3877 of the prototype.js library (version 1.6.0.2 from google: http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js). Now on this page I have a Google Map and I use the Prototype Window library. The problem occurs in ...

jQuery slicing and click events

This is probably a really simple jQuery question, but I couldn't answer it after 10 minutes in the documentation so... I have a list of checkboxes, and I can get them with the selector 'input[type=checkbox]'. I want the user to be able to shift-click and select a range of checkboxes. To accomplish this, I need to get the index of a chec...

jQuery: Can you select by CSS rule, not class?

A .container can contain many .components, and .components themselves can contain .containers (which in turn can contain .components etc. etc.) Given code like this: $(".container .component").each(function() { $(".container", this).css('border', '1px solid #f00'); }); What do I need to add to the line within the braces to select...

Changing the default title of confirm() in JavaScript?

Is it possible to modify the title of the message box the confirm() function opens in JavaScript? I could create a modal popup box, but I would like to do this as minimalistic as possible. I would like to do something like this: confirm("This is the content of the message box", "Modified title"); The default title in Internet Explor...

Looking for a simple JavaScript example that updates DOM.

The question says it all. :) ...

How do I get the current location of an iframe?

I have built a basic data entry application allowing users to browse external content in iframe and enter data quickly from the same page. One of the data variables is the URL. Ideally I would like to be able to load the iframes current url into a textbox with javascript. I realize now that this is not going to happen due to security iss...