javascript

ASTreeView help! (using JavaScript with .dll's)

I love the demos of ASTreeView. I'd like to use this in my project, which is completely local and currently only uses HTML, JavaScript, and CSS - i.e. no ASP.net or anything dealing with servers... Is it possible for me to use this? There is a .dll and a .js included in the package, but I have no clue where to start since this isn't a A...

javascript array with element ids

I have loaded an array in javascript with a select amount of input element ids on the form. Some of the input elements are radio buttons & checkboxes,. What I would like to do is something jQuery where I'm looping through my array and passing in the id like this: for(i = 0; i <= myArray.length - 1;i++){ alert($(myArray[i].val()); } ...

Can JavaScript catch a 404 error triggered by a page’s object?

The specific problem I’m facing is with a buggy Flash application that I don’t control. When it fails, I’d like to display alternate content. The page which contains the Flash content has loaded and it’s clearly the Flash app making the request that results in this message in the debug console: Failed to load resource: the server respo...

Retrieving previously focused element

I would like to find out, in Javascript, which previous element had focus as opposed to the current focus. I've been looking through the DOM and haven't found what I need, yet. Is there a way to do this any help would be much appreciated ...

jQuery: Determine if jQuery object is root html tag

Let's say I'm writing a jQuery extension method. This method should climb the ancestor tree of an element until it reaches the document's root <html> tag, at which point it should stop. I've implemented this as shown here: $.fn.foo = function() { var $foo = this; while($foo[0] !== $(document).children()[0]) { // do stu...

jCarouselLite turning buttons on/off

I have a very simple jcarousellite script working, but I want to be able to turn 'off' the left or right button when there aren't any more items to be displayed either right or left. Easiest way would be to simply change the background image used for the prev/next buttons I'm using via the div. http://sagescience.com/dev/car_test/ I'm ...

What is the point of unicode escape sequences in identifier names in JavaScript?

JavaScript allows for having unicode escape sequences in identifier names... for example: var \u0160imeVidas = "blah"; The above variable starts with the (croatian) letter Š, so that the complete name of the variable is "ŠimeVidas". Now, this is neat, but what's the point? Is there any scenario where this feature may be of any use? -...

Limit drag area of scriptaculous draggable

Im usign this to create a bunch on draggable elements: $$('.box').each( function(item){ new Draggable(item) }); How can I limit the draggable area? This way, the boxes can be droped anywhere on the page, and I would like to limit the drag area to their current parent element (I dont think I need to create a droppable). Or, at least, i...

Disable ASP.NET 1.1 Validator using JavaScript - Not Working in Firefox

The following attempt works in IE8 but not in Firefox (cannot use JQuery for this): case 'Template:templateControl:residenceRBL2': if (selected.value == 'Within USA') { /* Enable zip textbox and validator */ document.getElementById("Template_templateControl_zipTxt1").disabled=false; ValidatorEnable(document.getElemen...

JavaScript: get object instances to contain extended variables

So, say I had the following script: var hey = { foo: 1, bar: 2, baz: 3, init: function(newFoo){ this.foo = newFoo; return this; } } hey.check = function(){ alert('yeah, new function'); } Basically, I can call new hey.init(999) and get a new hey variable with hey.foo set to 999. But when I do tha...

How can I modify pasted text?

Is it possible to intercept and modify text that gets pasted into a textarea? If intercepting isn't possible, can I modify it after being pasted? (Without modifying the already present text in the textarea.) ...

Proper way to change text and elements on a page with JavaScript

Hi, I've been using innerHTML and innerText for a while to change elements and text on web pages and I've just discovered that they are not W3C standard. I've now found that innerHTML can be replaced with createElement, setAttribute and a few others but what is the best method for changing text inside an element? I found a textContent...

How do you make Node.js talk to a SOAP service?

I can't seem to find any examples on this. I see a listing on github for Node that says "Newspaper Club – Uses node.js for wrapping a nasty SOAP interface to InDesign Server.", but I don't see any code. Thank you. EDIT: I'm guessing that I could just find any javascript/SOAP kit and port it to Node. Any suggestions on a good one? ...

Passing an argument to a function in Javascript

I have a button which adds a paragraph each time it is clicked. In my code i have a function called addPara(count), and i have a counterstart variable. how can i pass this counterstart variable to me function? ...

How to compress a string?

Hi all, I would like to have a reversible compression for a type of string so that i can include it in URLs without keeping track of what it refers to. The string i would like to compress is SVG path string, here is a short primer: http://apike.ca/prog_svg_paths.html Basically, the string contains a character, followed by arbitrary num...

Need help with Flash, ActionScript, and JavaScript

Hi, I'm trying to have JavaScript call a function from my ActionScript. ActionScript: import flash.external.ExternalInterface; ExternalInterface.addCallback( "playSong", playSong ); function playSong():void { var _sound:Sound = new Sound(); var _request = new URLRequest("music.mp3"); _sound.load(_request); _sound.pl...

How can I convert \74 and \76 to its string representation?

I have this string Kindle-Wirel\\74wbr\\76ess-Reading-Display-Globally/dp/B003FSUD\\74wbr\\76M4/ref\\75amb_link_353259562_2?pf_rd_m\\75ATVP\\74wbr\\76DKIKX0DER\\46pf_rd_s\\75center-10\\46pf_rd_r\\07511EY\\74wbr\\76KTN682A79T370AM3\\46pf_rd_t\\075201\\46pf_rd_p\\075127\\74wbr\\0760985982\\46pf_rd_i\\75B002Y27P3M#jjdkasdjskjsk\\74wbr\\76j...

Always on top html block for iPhone

How can I create a DIV block that always stays at the bottom of my page? When scrolling more content should show up right above the block. The only solution i can think of is to use 2 iframes but I prefer using CSS. Update: The solution needs to work on iOS ...

How to make a Google mashup, allowing multiple users to pinpoint multiple locations on a map?

I need some inputs on how to show a map (public to all) and allow any user (whose email I should be able to track) to click several points on the map and make appropriate markers (it should just be visible as a point, nothing special). Other users SHOULD see those points as well. I should be able to access data on the backend as to who s...

Can I create a Mac like menu in CSS 3?

See the menu where it says Home. Can this menu bar be replicated using CSS 3 only? ...