javascript

jQuery: How to make function in an object public?

Hi there I use a pagination plugin and I'd like to make one of it's functions public, so I can call it from "outside". I can not call it directly, using pageSelected($(obj)). Is there an easy way to make it visible so I can call it? Jerry ...

Object Notation in Javascript

Hi, I'm trying to call a blur function on a variable assigned to a jquery object (an input field). How do I call the function on the variable? var someObject = { day: $('#dayInputField'), // input text field init:function(){ console.log("this.day" + this.day); // outputs object this.validateField(); }, va...

Forcing a tab stop on a hidden element? Possible?

The site is here: http://tinyurl.com/2wj8qb4 I have opt to using the radiobutton's labels as customized buttons for them. This means the radio inputs themselves are display:none. Because of this, the browsers don't tab stop at the radio labels, but I want them to. I tried forcing a tabindex to them, but no cigar. I have came up with ...

Pause JavaScript function

I need to pause a JavaScript function execution in the middle and then resume it after a button click. Please help me. ...

jQuery FullCalendar - create standard list of events from Gcal

I'm using FullCalendar in a project and the month view is great. But I also need to create a simple unordered list of the events gathered from 4 different Gcal feeds, and I haven't been able to do it. Anyone got any ideas? A quick response would be great. ...

Google Maps directions V3: Multiple directions on a map

I am trying to render multiple directions(well, their Polylines, essentially) on a single instance of a map. In the prior version of the maps API, I did something like //directions[] stores the GDirections objects //x[] is an array of Elements extracted from an XMLHTTPResponse object //iterating over the values in x[] GEvent.addListener...

Clone a div and then clone again from the child

I have the following simple code, where I double click a div (with class container) and it's simply clones itself inside another div (with id containment-wrapper): html <span class="container">div one</span> <div id="containment-wrapper"> </div> Jquery $(".container").dblclick(function() { $(this).clone().appendTo('#contai...

Create JS execution blocking dialogs using jQuery

I have an existing web application which uses window.showmodaldialog() to show certain forms and based on the return value it executes some other JavaScripts For example: var retVal = window.showmodaldialog('...'); if (retVal==XXX) callXXX(); else callYYY(); When showModalDialog() is executed it blocks the JS execution on the ma...

Making an HTTP POST call with multipart/form-data using jQuery?

I'm trying to make a HTTP POST call with multipart/form-data , using jQuery: $.ajax({ url: 'http://localhost:8080/dcs/rest', type: 'POST', contentType:'multipart/form-data', data: 'dcs.source=boss-web&query=data&dcs.algorithm=lingo&dcs.output.format=JSON&dcs.clusters.only=true', //dataType: "jsonP", success: function(jsonDa...

How do I make my UI 'degrade gracefully' with Javascript disabled?

I've read in multiple posts on SO that if users have Javascript disabled, ideally your page should 'degrade gracefully'. I'm not sure in general what types of things should be done to make this happen. I have a blob of HTML for configuring a 'schedule'. Depending on the value of a select box, different fields are shown. <select name=...

How to capture an arbitrary number of groups in JavaScript Regexp?

I would expect this line of JavaScript: "foo bar baz".match(/^(\s*\w+)+$/) to return something like: ["foo bar baz", "foo", " bar", " baz"] but instead it returns only the last captured match: ["foo bar baz", " baz"] Is there a way to get all the captured matches? ...

Free JavaScript chessboard

Could anybody suggest a free (as in freedom) and open source JavaScript chessboard? My plan is to hook it up with some server-side Python code, most probably it will be the flask web framework. I need a really minimal set of features: a way to display a position on the board (not only the initial one) when generating the HTML code by ...

jQuery text() does not work before a setTimeout?

Hello all, After an Ajax request, I perform the following. $('#change_ts').text('Defaults Changed!'); //blinking part var t = setTimeout($('#change_ts').fadeIn('slow'), 500); clearTimeout(t); var t = setTimeout($('#change_ts').fadeOut('slow'), 500); clearTimeout(t); var t = setTimeout($('#change_ts').fadeIn('slow'), 500); clearTime...

Trigger resize event on print

I have a div in which I create a chart using protovis. The div has width: 100% and height: 100% and the code to create the chart uses $('#chart').width() and $('#chart').height() to get the size of the div at render time and fill the page with the chart. I capture the resize event on the window and adjust the div and the chart so that ...

what is the default action happening when we drag over an image ?

Hello What is the default action happening when we drag over an image ? When I drag over an image the cursor changes to a black circle with a line inside (in Firefox) I could block it by the code e.preventDefault() using jquery, but I didn't understand what is the default action happening when I drag over an image. Thanks ...

How to know which submit button fired the onsubmit event

When you have more than one submit button in a form, is there a way to know which one fired the onsubmit event without adding code to the buttons themselves?? Edit: I need to do the check on the client-side, i.e. with JavaScript. ...

Classic ASP Auto Suggest Like Google

While working on a project i came across a functionality in which i need to implement auto suggest textbox using classic asp. I did it and it works fine. I'm using XMLHttp Request object to pick the database column values when user enter something in textbox. Everything works fine. But if the table have too many rows (37,000+) in it, t...

(Groovy/Grails) What to do about URLs in JavaScript module that need to change per environment (dev/prod/qa/etc)

I’ve punted on this before, and/or hacked around it, but I’d like to solve it properly once and for all. The question is what to do if I need a URL that changes per environment in a JavaScript module that's part of a Groovy/Grails project For example, I have a JavaScript module that contains this function: function init() { dojox....

converting simple pagination in javascript into jquery code

hey guys i have a simple pagination pagination code that had been writen with raw javascript codes function ChangeForumPage(e){ if(busy == 0) { switch(e) { case "Next": page = p+1; p++; break; case "Prev": if(p>1) ...

Javascript document.getSelection

I'm trying to use the document.getSelection to select text I have entered in an text area for a WYSIWYG editor. It only works if you select text outside the text area though. I don't know if there is a way you can make it select text inside the text area? Below is the text area for a WYSIWYG text editor: <iframe id="editor" width="100%...