javascript

Ruby on Rails keyboard shortcuts

Hi all - does anyone know how to set-up keyboard shortcuts using Ruby on Rails on my website? For example if a user want to interact with the site using keyboard shortcuts instead of clicking buttons/links how would I do this? Any help is greatly appreciated. Max. ...

IE Caching issue is breaking my lookup field.

I'm doing a project which uses javascript to get info from a view (written in Python and using the Django interface) based on the text a user enters in a field (querying on every keyup), and then display that info back. Basically, this either displays 'no job found' or displays the name, username, and balance for that job. In Firefox, ...

Javascript Scope and local variables

I'm really not sure if this is possible in Javascript. Here's my function: var tree = function(name, callback) { if (this.name) { this.name.push(name) print(this.name) } else { this.name = [] } callback() } I'd like to use it as follows and print out the heirarchy: tree("john", function() { tree("geoff", functio...

how to modify the document selection in javascript?

I wanna modify the document selection (user currently selected by mouse or keyboard), how to do it in a cross browser way? ...

Displaying the axis values for a mouseover event in a chart image

I return a chart image (with axis x and y) to the browser created my matplotlit. Now I want to show the axis values when there is mouseover event. ...

Function fails on the second time i call it.

Hi, this is my code: <script language="javascript"> function refresh() { try { xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} xmlhttp.onreadystatechange = triggered; xmlhttp.open("GET", "data.php"); xmlhttp.send(null)...

How to access external JAR files from JavaScript using Rhino and Eclipse?

Hi, I'm using Mozilla Rhino to write a JavaScript server application. I would like to include the HttpClient classes in my project to easily access the web, but I can't figure out how to configure my Eclipse project to get Rhino to load the HttpClient JAR file. I have added js.jar (from Rhino) and httpclient-4.0.1.jar to my project's b...

How can I launch a javascript from an <iframe>?

There is an iframe on the page. Can the parent document (iframe parent) be accessed from this iframe? What I want to do: when the user presses a button inside iframe something happens on the main page Thanks! ...

Limit Textfield Input to digits only

Hello. I've searched Google, but all the solutions I could find were really complicated and long. What I need is to limit the input of a textfield in a survey I'm making to digits only. What is the quickest and cleanest way to do this? (I'm using HTML 4.01 strict and ECMAScript) Thanks in advance. ...

Using jQuery in a Wordpress post

I'm wanting to post live jQuery examples in my Wordpress posts, and so need to be able to include working code in the actual post itself. I've turned off the WYSIWYG editor and any settings which may mess up my code when I publish. I've also, through the exec-php plugin, been able to get php code working in-post, but this (admittedly old...

How do I detect if a javascript constructor already been run?

I'm using the jquery-tools tabs and carousel in a page I'm working on. The carousel is embedded within a tab, and the tab is loaded in a beforeClick callback. Normally, the carousel is initialized in the document ready function like so: $(function() { // initialize scrollable $("div.scrollable").scrollable({ ...

Coda Slider Problem - Works in Firefox, Not Chrome/Safari...

I am building a page that is employing several different javascript elements and I seem to have run into a problem I haven't before (not surprising as I am new to javascript). I have implemented the tutorial for the JQuery Coda Slider located here: http://jqueryfordesigners.com/coda-slider-effect/. It seems that the sliding effect wor...

Scaling Images Proportionally in CSS with Max-width

Right now, I'm using max-width to scale images to fit. However, they don't scale proportionally. Is there a way to cause this to happen? I'm open to Javascript/jQuery. If possible, is there a way to do this without knowing the original dimensions of the image (maybe determine this using Javascript/jQuery)? ...

How to close current tab in a browser window ?

I want to create a link on a webpage that close current active tab in a browser without closing other tabs in browser. When user click that close link a alert message should appear asking user to confirm with two buttons, "YES" and "NO". If user clicks "YES", close that page and If "NO", do nothing. How it will be done? Thanks ...

creating a carousel with javascript?

Hi All, I want to create a carousel where if the user press prev and next only the image and its associated text should be displayed. Like for first item that is Image1, This is Image1 text should be displayed then if the user presses next Image2 and This is Image2 should be displayed. Below is my code Thanks <html> <head> <styl...

"Object Expected" error while capturing the page load event.

The following code inside the tags gives error: "Object Expected". <!-- JQuery/AJAX--> <script type="text/javascript"> try { $(document).ready(function(){ $("p").load(function(){ MakeRequest('divElectionCategory','ulElectionCategory','SELECT * FROM electioncategorymaster',...

difference between $("#id").load and $.ajax?

hello, does anyone know what is the difference between $("#id").load and $.ajax? ...

script were i can change the text dynamically when the page is live using javascript

hi everyone .. i want a javascript were i can change the text dynamically when the page is live from (Arial to Times) something like that..but when i click arial or times the page should nt get refreshed can any one pls help me in dis.. or can anyone pls provide a script for dis..??? ...

auto generate javascript to update client html compared to previous html?

do you think it would be difficult to write a framework where mvc compares last html it output to the current html we want to output, and instead of sending the entire html, figure out what has changed and generate js code that will do the updating as compared to previous html? (presuming nothing was manually changed on the client using ...

ExtJs 3.1.0 : the documentation (docs/index.html) does not use the same "official" ext-all.js source code

If you download extjs-3.1.0 you'll see in the folders two versions of ext-all.js: The first one is at the root and is 649 777 bytes. The second one is in the ext-3.1.0\docs\resources folder and is 538 956 bytes. If you modify the ext-3.1.0/docs/index.html file and change this simple line: <script type="text/javascript" src="resources/...