javascript

Comet (long polling) and XmlHttpRequest status

I'm playing around a little bit with raw XmlHttpRequestObjects + Comet Long Polling. (Usually, I'd let GWT or another framework handle of this for me, but I want to learn more about it.) I wrote the following code: function longPoll() { var xhr = createXHR(); // Creates an XmlHttpRequestObject xhr.open('GET', 'LongPollServlet', tru...

How do I get the ID or reference of the listview row I am clicking a checkbox in?

I have an ASP.NET 2.0 ListView control (aka:parent) and configured inside this ListView I have another ListView (aka:child). For each row the parent has there is potentially a child ListView control which can have 1-3 rows. Each row has two checkboxes (a select checkbox and a deny checkbox). I need to process these checkboxes in JavaSc...

How do I add Google Maps on my site?

I have a form and I want to add a "select location" option. How can I do this, and how can I place a pin as the selected location? ...

NS_BINDING_ABORTED Javascript window.location.replace()

Hi all, I'm writing some Javascript code and I'm trying to change the current page as the result of the user clicking a button. I'm using this snippet of code: window.location.replace("/customer/order/12"); containing the relative URL within my site that I want to navigate to. When this code runs (looking at it in Firebug), the url st...

uploadify email notification

Is it possible for "Uploadify" to send out e-mail confirmation after the upload? Uploadify is a jQuery plugin that allows the easy integration of a multiple (or single) file uploads on your website. It requires Flash and any backend development language. An array of options allow for full customization for advanced users, but basic im...

Changing cursor to wait cusor while waiting for applet to load

I have an application where an HTML page first loads, then an applet with lots of data loads. It takes some time for the applet to load and while the applet is loading the customer would like an hour glass to be the shape of the wait cursor (even though the Sun Java display is doing its usual thing). I know the javascript command f...

[JavaScript] Pass a defined function as a parameter

Hello, I am trying to pass in a function as a parameter: GEvent.addListener(marker_1, "click", populateMarkerWindow(0, marker_1) ); the addListener function takes an inline function as a parameter, and it works fine, but I want to call this function from other places as well, so I made it into a defined function: var populateMarker...

How do I select 100 pixels (10 x 10 block) at a time with Canvas/Javascript?

Hello all, I'm trying to accomplish what's being demonstrated at this site for an experiment I'm working on. The blocks are to be selected via mouseclick I suppose. As a Javascript newbie, I don't know where to begin something like this myself. Adding the HTML canvas element into the mix (since it's gaining in popularity and pretty g...

Using "class/object" MooTools-style events in jQuery

One of the nice things about MooTools, is that it lets you easily assign/fire events to objects, for example: var playerSingleton = new (new Class({ Implements: [Events], initialize: function() {}, setVolume: function() { // do some stuff.. this.fireEvent('volumeChanged') } })); // Somewhere else... playerSingleton...

Long Press in JavaScript?

Hi, Is it possible to implement "long press" in JavaScript (or jQuery)? How? HTML <a href="" title="">Long press</a> JavaScript $("a").mouseup(function(){ // Clear timeout return false; }).mousedown(function(){ // Set timeout return false; }); Thank you! ...

Firebug not showing ajax requests

I have all tabs enabled... like a week ago it just stopped showing ajax requests in the console.... I'm not sure what to do about it. Any ideas on what I can do to fix it? Update When I use console.log(el); it says console is undefined as well. ...

jquery select link by name

i can reference link with specific id with following code $(document).ready(function(){ $("a#example_link_id").click(function(event){ var url = $(this).attr("href"); get_uid(url); //event.preventDefault(); }); }); is it possible to use $("a#example_link_id") this by link name ...

ASP.NET Web User Control with Javascript used multiple times on a page - How to make javascript functions point at the correct controls

I think I summed up the question in the title. Here is some further elaboration... I have a web user control that is used in multiple places, sometimes more than once on a given page. The web user control has a specific set of JavaScript functions (mostly jQuery code) that are containted within *.js files and automatically inserted in...

ASP.NET control event handler not firing on postback?

I have a control which has an ImageButton which is tied to an OnClick event... Upon clicking this control, a postback is performed and the event handler is not called. AutoEventWireup is set to true, and I've double checked spelling etc.... We haven't touched this control in over a year and it has been working fine until a couple of w...

passing in javascript values into iframe tag

What's the best way to pass in the value held in a javascript variable into an iframe call on the same html page? I'm trying to improve my site's page response times by moving ad serving javascript code (the typical document.write('<script type="text/javascript" src="..") into a separate iframe. (Based on this posting) The request to ...

window.onbeforeunload is being triggered in the iFrame (CKEDITOR buttons)

On a page where I have a CKEDITOR text editor I have the following code to prevent the user from leaving the page and losing all their data: window.onbeforeunload= function() { if (CKEDITOR.instances.stuff.getData().length > 0 && oktoquit == false) { return "You have unsaved changes. Click Cancel now, then 'Save' to save the...

How do I make nested options for plugins in jQuery

I know how to do plugins, but how do I do nested options like: var defaults = { spacing:10, shorten_to:50, from_start:0, from_end:2, classes: { test:'testing' } }; i know that isn't right, i just dont know how to write the proper syntax when I want to do something like this: $('#breadcrumbs').breadcrum...

Transforming highlighted text inside an element using javascript

My goal is to be able to get the highlighted text within a document, but only if that text is within a given section, and then apply a certain style to that selected text after clicking a div tag. I'll explain what I mean: So, having looked at window.getSelection() and document.selection.createRange().text, I attempted to use elmnt.get...

How can I dynamically update two id values in a javascript driven time tool?

I'm building a simple time tool (php, mysql, js) that takes the current date and time (both formatted and raw unix timecode) and provides sliders that allow people to add time to an event. There are three units, days, hours and minutes. Clicking on up or down arrows is adding the appropriate time to a hidden "timecode" field. The field...

jquery animate and image resize flickering

Hi, i've a problem with a resize effect that i've done in http://www.mcz-scenario.it. When you click on a language, you can see the "background" image transferring into a certain position of the screen. this is the image: <img id="lago" src="http://www.mcz-scenario.it/images/lago.jpg" height="1070" width="1600" alt="lago" /> And this...