javascript

Free JavaScript obfuscators?

I'm looking for a free JavaScript obfuscator. Would compression be enough? What tools would you recommend? Of course, I don't need military-style obfuscation, I need a simple way to prevent kiddies from stealing my javascript by looking at the source or by using something simple such as unescape(). Thanks, Tom ...

Does noscript get acknowledged by javascript enabled browsers?

I'm looking into tightening up our ad code by moving it to an external jQuery script, but I obviously still need some HTML to target the ad to. So I was wondering if I can target a noscript element (or within a noscript element) since I'm going to have to leave that on the page anyway, or if I need to have some other element for the Java...

Is it possible to disable AJAX without disabling JavaScript completely?

The subject says it all: Is it possible to disable AJAX without disabling JavaScript completely? Thank you all! Regards, Frank ...

How can I properly hide a list of XSL processed XML elements using javascript

Good morning. I have an XML file which contains lists of warning and errors from a build output. I have successfully been able to write XSL to iterate over the separate lists of warnings and errors to have them display in my browser. What I'd like to do next would be to add a bit of javascript in order to add a link/button to be able ...

Open/Close Icons

I'm doing some shennanigans with jQuery to put little plus/minus icons next to my expanders. Its similar to the windows file trees, or firebugs code expanders. It works, but its not specific enough. Hopefully this makes sense... $('div.toggle').hide();//hide all divs that are part of the expand/collapse $('ul.product-info li a').to...

Printing only a textarea

I would like to print only the contents of a textarea element from a website page. In particular, I would like to ensure that nothing gets clipped by the boundary of the textarea as the contents will be quite large. What is the best strategy for tackling this? ...

How efficient is element.cloneNode(true) (deep clone)?

I'm building the HTML code within an XML DOM object to be used as the contents of the innerHTML of a div element using an XSL template. Traditionally we create a new XML DOM document and add the input parameters as XML Elements for the transform via javascript. This is all very time-consuming as we are basically hand picking the data fro...

Is there a version of JavaScript's String.indexOf() that allows for regular expressions?

In javascript, is there an equivalent of String.indexOf() that takes a regular expression instead of a string for the first first parameter while still allowing a second parameter ? I need to do something like str.indexOf(/[abc]/ , i); and str.lastIndexOf(/[abc]/ , i); While String.search() takes a regexp as a parameter it does n...

AJAX/jsp/HTML vs Applets

Which approach is better? Having jsp/HTML based web application which allows you to traverse web pages in the browser. An applet based web application which opens up a Swing applet screen? ...

How to determine direction of navigation from IE WebBrowser (IHtmlWindow2 or Javascript)

I'm uisng the WPF Web Browser control and when it fires the Navigating event, the event args always contain NavigationMode.New. It should be set to NavigationMode.Back if the user chooses to 'Go Back' from the web control. So its off to the COM ActiveX control underneath to determine the direction of navigation. I've been looking at I...

Preventing click event with Scriptaculous drag and drop

I have some elements on a page which are draggable. These same elements have a click event which navigates to another page. I'm trying to determine the best way of preventing the click event from firing if the user is dragging but still allow the click event if not dragging. Anyone have any ideas of the best way to accomplish this? ...

Mobile Device Javascript/CSS Support. What's out there?

I'm about to begin an ASP.NET application that will be targeted towards iPhones, Blackberries, and Windows Mobile browsers. Aside from the iPhone, I haven't been able to find much information on what technologies these platforms support. Since I'm used to developing for desktop browsers, I like using things like jQuery and advanced CSS ...

Double-Escaped Unicode Javascript Issue

I am having a problem displaying a Javascript string with embedded Unicode character escape sequences (\uXXXX) where the initial "\" character is itself escaped as "\" What do I need to do to transform the string so that it properly evaluates the escape sequences and produces output with the correct Unicode character? For example, I...

How to make a submit out of a <a href...>...</a> link?

The title pretty much says it all. I got an image with which links to another page using the < a href="..."> < img ...> < /a> How can i make it make a post like if it was a button < input type="submit"...>? ...

Wheel Reinvention Avoidance for Web Rating Feature

I have a need to implement a rating feature and would like to do it the mouse-over stars way similar to netflix. What is my best approach? Here are some that come to mind. code it up by hand in HTML and javascript use flash or a java applet use Starbox (if you have used Starbox, then feel free to comment on it) use another java script...

windows.location.href not working on Firefox3

We have a javascript funtion named "move" which does just "windows.location.href = any given anchor". This function works on IE, Opera and Safari, but somehow is ignored in Firefox. Researching on Google doesn't produce a satisfactory answer why it doesn't work. Does any javascript guru knows about this behavior, and what would be the ...

Javascript Reflection

Is there a way to get all methods (private, privileged, or public) of a javascript object from within? Here's the sample object: var Test = function() { // private methods function testOne() {} function testTwo() {} function testThree() {} // public methods function getMethods() { for (i in this) { alert(i)...

Add HTML control(s) via javascript

Something is eluding me ... it seems obvious, but I can't quite figure it out. I want to add/remove a couple of HTML controls to a page (plain old html) when a user changes value of a dropdown list. An example is to add or remove a "number of guests in this room" textbox for each (of a number) of rooms requested ... So if a user sele...

Javascript callback functions and recursion

This is kind of a brainteaser question, since the code works perfectly fine as-is, it just irritates my aesthetic sense ever so slightly. I'm turning to Stack Overflow because my own brain is failing me right now. Here's a snippet of code that looks up an address using the Google Maps JS API and places a marker on a map. However, someti...

How do you read this JavaScript regular expression?

var pattern = /^0+$/; My guess is this: "Take a look at both the beginning and the end of the string, and if there's a pattern of one or more zeros at the beginning and the end, then return that pattern." I'm sure that's wrong, though, because when I run the expression with this string: var string = "0000009000000"; It comes up nu...