javascript

Creating checkbox elements on the fly with jQuery - odd IE behavior

I'm creating some checkbox elements on the fly with jQuery and appending them to a node like so var topics = ['All','Cat1','Cat2']; var topicContainer = $('ul#someElementId'); $.each( topics, function( iteration, item ) { topicContainer.append( $(document.createElement("li")) .append( $(document.createElement("input...

Javascript regex

I was trying to do a regex for someone else when I ran into this problem. The requirement was that the regex should return results from a set of strings that has, let's say, "apple" in it. For example, consider the following strings: "I have an apple" "You have two Apples" "I give you one more orange" The result set should have the fir...

how do you folks handle complex state situations where order of operations is important?

Hello, I'm getting in to a situation where I have several interacting widgets (on a web UI), all of whom can be in multiple different states, and whose behavior depends on others the others. I'm running in to situations where, for example, a set of data gets sorted twice, or the data gets displayed before it's sorted, rather than the oth...

JavaScript Regexp to Wrap URLs and Emails in anchors

I searched high and low but cannot aeem to find a definitve answer to this. As is often the case with regexps. So I thought I'd ask here. I'm trying to put together a regular expression i can use in JavaScript to replace all instances of URLs and email addresses (does'nt need to be ever so strict) with anchor tags pointing to them. Obv...

What do you call DHTML these days?

So lately I've been catching a lot of crap from a junior developer whenever I use the term "dHTML". I know the term is dated, but it's descriptive of what the task is: changing rendered markup on the client. I cringe whenever i see the term Ajax applied to client side animation or form validation where no asynchronous request is being ma...

How can I determine the SelectedValue of a RadioButtonList in JavaScript?

I have an ASP.NET web page with a databound RadioButtonList. I do not know how many radio buttons will be rendered at design time. I need to determine the SelectedValue on the client via JavaScript. I've tried the following without much luck: var reasonCode = document.getElementById("RadioButtonList1"); var answer = reasonCode.Select...

What are some techniques for improving UI responsiveness?

In the example below, can anyone tell me how to make "slow response when clicked" respond more quickly without modifying appendContent()? I'm wondering if there's a way to place cheap operations before more expensive ones, and make sure the cheap ones actually get carried out quickly. <div id="draw">slow response when clicked</div> <di...

Simple AJAX Script will NOT load on Homepage only

My email script on the left navigation panel... under "Brad's Secrets of Attraction" will not load on the homepage. It works on EVERY other page. Live Site: BradP.com SITE MAY BE NSFW This is strange to me. Does anyone know why? ...

HTTP Request, loading javascript DOM manipulations that have been made to the HTML

I'm currently using cURL to do HTTP requests, and it works fine. However I need to get the javascript code and execute it in the context of the HTML, making it manipulate the DOM exactly as if it were a web-browser. The first thing that came to mind was to use firefox, there's a command-line interface so I thought it would be easy (mayb...

Cannot get Adobe AIR's ApplicationUpdaterUI() to work

Here is my problem - I'm trying to write a self-updating application, but I keep getting an error saying that runtime.air.update.ApplicationUpdaterUI() does not return a constructor. Here's the relevant section of the code; there are other javascript files being included, but I don't think that any of them would be actively breaking AIR...

RJS: Ajaxified select_tag

Since I didn't get the expected answer on my last question I'll try to simplify and narrow my question: How can I build a dropdown-menu that uses AJAX (no submit-button) to call the show action of a certain controller? The following things are given: Model-Association is Categories HABTM Projects, therefore the dropdown-menu consi...

Can Firebug set breakpoints in external JavaScript files?

Is there any way in Firebug to set a breakpoint in an external .js file that a page links to so that it can be stepped through? (I suspect I've found a bug in jQuery and I want to be able to step through jQuery as it's handling events to see what it's doing.) ...

Alter CSS class attributes with javascript?

Hi everyone, I have a css class defined, call it: <style type="text/css"> .Foo { position: fixed; left: 50px; top: 50px; } </style> where I position an element on the screen absolutely. Throughout my web page's execution, I create and delete many elements and give them class Foo. When I resize the browser, I want to change the "le...

changing hidden field in client side problem

I have a hidden field and I change the value just before submitting the form using Javascript. But in server side it is null or empty. Request.Form["hidAction"] is empty. <script type="text/javascript" language="javascript"> function DoChange() { document.getElementsByName('hidAction').value = "filter"; alert(d...

Redirect automatically when selecting an item from a select drop-down list

This page does it the way I want it to: http://www.web-source.net/javascript_redirect_box.htm But I want to find a better way using jQuery, can anyone point me to a good script that uses jQuery to accomplish this? ...

.NET, Java to JavaScript compiler

I am interested to create a drag-and-drop layout designer using only JavaScript, HTML and CSS. The designer will allow the user to drag the page elements from one place to another (something like Blogger's layout designer) to create a site layout. But I don't want to hand code everything in JavaScript, I would prefer to write my applicat...

horizontal scrolling? javascript

hey all, I'm looking for a simple method of making a DIV animate horizontally based on anchor points. I'd rather not download an entire library for this if possible... can anybody suggest any resources for me to learn the inner workings of this? thanks all:) ...

How can I get the original text node of the event?

for example ,I have the following html <HTML> <HEAD> <script type="text/javascript"> function trackElement(event){ event=event||window.event; var target = event.explicitOriginalTarget||event.srcElement||document.activeElement; var targetText = target.nodeValue||target.innerHTML; alert(targetText); } </script> </HEAD> <BO...

How to redirect parent window from an <i frame> using Javascript?

What the title says. How can it be done? I want them to click a hyperlink which, using javascript or any other methods, would redirect the parent window to a new url. ...

What exactly does this url mean?

I am using different analytics tags in one of our web applications. Most of them call a javascript code for tracking. Some tags have url of gif image with querystrings. Example : http://www.google-analytics.com/__utm.gif?utmwv=45.542 What exactly does this url do? How do they get the values from querystring? Update: (After reading s...