javascript

Access to Leafs of a TreeNode in a Ext JS Tree

Hello StackOverFlow, I am using the Ext JS library for creating my application. I have a tree panel that has tree nodes and children tree nodes. These tree nodes have leafs that I would like to be able to access. I've been searching for a while, but cannot find a function of property to access the leafs :( Some code is here: var i;...

jQuery AJAX function can't see my variable

I have the following code, which i've simplified, where $currEl gets logged and displays correctly, but in the $.ajax call it logs as null. Am I missing something? for(var i=0, j = atgSlots.length; i < j; i++) { var currSlot = atgSlots[i].split('|'), $currEl = currSlot[0].length ? $('[data-atg-url=' + currSlot[0] + ']') : null, ...

How google analytics' asynchronous api is able to track clicking links

If I have html like the following on my own site how come it is able to track the event? Is it possible that browser starts loading the http://google.com in the same window before the tracking request is made as it is asynchronous? <a href="http://google.com" onclick="_gaq.push(['_trackEvent', 'category', 'event']);">click</a> In case...

The Javascript Datastore Problem

This might sound super crazy but I really want to know if this can be done. Assume a multi-user site that gives users some tools to build web apps from the site itself (using only HTML/CSS/JS) and share them. Now, if each of the apps were to be assigned a datastore, say just a table for convenience, is it possible to make secure query/i...

css tabs with jquery

Hi I am trying to create tabs with CSS and Jquery but I dont know why I am not getting the right content when the appropriate tab is selected. thanks for ur time <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; <html> <head> <title>Follow me!</title> <style type="text/css"> ul.tabs { ...

Adding a Modal Dialog on page load

I am just starting out learning some HTML and Java coding (read: I know practically nothing about this stuff) and would like to have my index.html page open an HTML file when it loads. Essentially I am looking for a kind of Modal Pop-Up. I have been researching jQuery and its various plugins (i.e., LightBox, prettyPhoto, Boxy, etc.), b...

Need to validate Textbox to enter certain condition using Javascript

Hi all, Need to validate textbox using javascript as below condition : Length of the letter should be atleast 6 First Letter should be Capital Atleast One Numeric value should be there Atleast one special character should be there How to do that? ...

Displaying a <div> over a <canvas>

The problem, which exists in both Firefox and Chrome, is that I have a canvas with a solid background, and a div with a solid background color/image. The div is margined up over top of the canvas. The div does not display over the canvas. An interesting note is that if there is text inside the div it will properly get displayed. This wou...

Google Chrome won't let me place breakpoints

I've been using Google Chrome to debug my javascript, but then all of a sudden I can no longer place breakpoints. I click on the line number, where I previously clicked to add a breakpoint, but no breakpoint will be added. Sometimes if I click very fast, like a madman, I can see it trying to add breakpoints, but it won't stick. The only...

Find out which object was clicked on a html5 Canvas

Suppose i have a html5/canvas application in which i can place objects on a drawing-canvas. Some kind of diagram editor, something like Visio (but much simpler) Is there a framework which helps me find which object is clicked/draged? An option is to capture the click-event and iterate over all my objects (in a semi-smart way) and che...

Bolden Matched Search Text

I'm writing a custom control which includes a text box input and an unordered list of items below it. As the user types in the text box I would like for the matched text in the list to be bolded (wrapped in <strong> tags). //I use keyup so the value takes in to account the last keystroke. $('#filterList').keyup(function() { ...

Google Analytics - how does it track clicks?

So I'd just like help understanding how exactly google analytics collects this info. I have a homepage and the statistics say that 46% of clicks are on the logo (which links to the homepage). Does google analytics just assume that if they've ended up on the homepage they have clicked there? How accurate is this measurement? I wonder be...

Javascript to respond to changes in the # portion of the url

I am trying to use jQuery to respond to changes in the url after the #. I've done some searching, but I don't think I'm using the right search terms. To be clear, I want to be able to provide external links to a page like so: <a href="example.com/foo/#home">home</a> and to include internal links to change the content on the page dyna...

Why is this javascript inserting two spinner images?

// javascript for ajax pagination// document.observe("dom:loaded", function() { // the element in which we will observe all clicks and capture // ones originating from pagination links var container = $(document.body) if (container) { var img = new Image img.src = '/images/spinner.gif' function createSpinner() { ...

Javascript template disappears on clicking any control.

I have used the Javascript Menu template from Sothink and embedded it in my Master Page. Now when I click on any control of a form like a Radiobutton or a Linkbutton, etc. the Side Javascript Menu disappears. I don't understand why. Initially it shows but later disappears on clicking a redirecting control. Can anyone help me correct ...

Div Lights Fade Script - Not working on Mac?

Hello, I have a little javascript/css script that fades my website to black, except for the video in the middle, to give a sort of theatre effect Example : http://www.animefushigi.com/bleach-episode-293 Click LIGHTS OUT The script adds a black overlay on the entire page except for the "vidboxx" div. Some people say that it is worki...

Safari caches JSONP requests locally

I have a page that makes the same JSONP request multiple times in a single page load. In most browsers this works fine, but Safari caches the response locally until such time as the page is reloaded. Even when I send back a Cache-Control: no-cache header on the response. consider the following example code: var plcbCnt = 0; var plcb ...

is there an easy way to track a javascript variable with firefox?

I am looking for an easy way to track the many changed of a variable in firefox. I am looking for something that will not require me to add reduntant code, like alert, or console.log, but rather way to tell firefox to report each time a JS var is changed am I dreaming? ...

Generate sound using JavaScript

I am trying to generate sound using JavaScript. I have used the following code <html> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script> function PlaySound(soundObj) { var sound = document.getElementById(soundObj); sound.Play(); } function init() { //alert(""); PlaySound('sou...

How do I find out what date format this is?

Wed Oct 20 2010 14:11:39 GMT-0500 (CST) {} More detail (sorry): I'm trying to pass in a date (like above) from the fullcalendar plugin to the jQueryUI datepicker like so: $('#miniCalendar').datepicker({defaultDate: date}); where date = Wed Oct 20 2010 14:11:39 GMT-0500 (CST) {} datepicker accepts a variety of ...