javascript

Internet Explorer matrix transformation filter problem

As one of my hobby projects, I'm developing an image effects jQuery plugin. It's supposed to allow you to apply a few basic effects to an image, and it does this by using the canvas HTML element (for browsers that support it), or Internet Explorer filters (for, well, Internet Explorer). A demo page is available at: http://sandbox.odynie...

"Node cannot be inserted at the specified point in the hierarchy"

Hi, I am doing JavaScript Scaffold-like thing. And, code below is showing table. It works normal for all of them, and not for only one table I am getting - in the centring of processing on the third row - I get exception "Node cannot be inserted at the specified point in the hierarchy". function table_one_view(table) { $.getJ...

Fake "click" to activate an onclick method

I have an element with an onclick method. I would like to activate that method (or: fake a click on this element) within another function. Is this possible? ...

Javascript / Flex communication use case [need advice]

Hello everyone, I have a web page with a flex component, the flex component is responsible for creating an image from user inputs. Once an image is ready the user enter some more information in the HTML form and click on the send form button. When this button is clicked, javascript calls a function on the flex components which returns...

jquery - changing an element id

I need to change an element ID. (yep, jQuery newbie) Apparently these don't work: jQuery(this).prev("li").attr("id")="newid" jQuery(this).prev("li")="newid" I found out that I can make it with the following code jQuery(this).prev("li")show(function() { this.id="newid"; }); But that doesn't seem right to me. There must be a b...

set an iframe source without loading new content

Is there any way to set the src attribute of an iframe without the iframe generating an http request? If not, is there a way to format the request headers before the request is sent? edit: I just need the src to match the path of a cookie, but I don't ever want that cookie sent to the server. See my comments on this question. ...

Is there an ASP.Net MVC view engine that supports JavaScript views?

I would like to generate some JavaScript on the server side in ASP.Net MVC. Is there a view engine that supports this? Ideally I would like to be able to get JavaScript from an url like: http://myapp/controller/action.js I've looked at the MonoRail project, and they seem to have this feature, but it's very lacking in documentation, a...

Updated- more specifics-->How can I do a script to catch strings as input and open them on a firefox document?

How can I do a script to catch strings as input and open them on a Firefox document? Each link would go to a different window or tab. Any ideas would be much appreciated. I just want to be able to take some links and open them. For example I have 50 Links. And copying and parsing those 50 Links take a really long time and also a lot of ...

Counting Results in an Array

By means of a regular expression and Greasemonkey I have an array of results that looks like: choice1, choice2, choice3, choice3, choice1, etc.. My question is how do I tally up the choices so I know how many times choice1 is in the array, choice2 is in the array, etc. if I do not know exactly how many choices there are or what they...

How do I compare dates in Javascript?

I have the following situation: I have a certain function that runs a loop and does stuff, and error conditions may make it exit that loop. I want to be able to check whether the loop is still running or not. For this, i'm doing, for each loop run: LastTimeIDidTheLoop = new Date(); And in another function, which runs through SetInte...

jQuery slider range

I am trying to use the range property of the jQuery slider so that the slider control displays two handles from which the user can select a price range for real estate. The code I have is: $("#price").slider({ range: true, minValue: 0, maxValue: 2000000, change: function(e, ui) { var range = (Math.round(ui.range) * 10) + " to " ...

How do I implement client side replacement with Javascript?

I have a HTML page with which I want to do some client side replacement using Javascript. The values I would like to replace are in an array like so: var searchFor = new Object(); var replaceWith = new Object(); searchFor = [ "quick", "brown", "fox", ]; replaceWith = [ "nimble", "black", "cat", ]; So every instance of 'brown' s...

Javascript mouse location

How do I check if the mouse pointer is in/on another div/id/a? ^a href="#" onmouseover="showmenu('top_3_menu_1_1')">Option One function showmenu(elmnt) { document.getElementById(elmnt).style.visibility="visible"; } function hidemenu(elmnt) { if mouse pointer is not in location A or B do something } ...

How do I reduce view duplication between client and server?

I'm working on an AJAXy project (Dojo and Rails, if the particulars matter). There are several places where the user should be able to sort, group, and filter results. There are also places where a user fills out a short form and the resulting item gets added to a list on the same page. The non-AJAXy implementation works fine -- the v...

Fastest javascript page search

I am writing a Firefox extension. I would like to search the current webpage for a set of words, and count how many times each occurs. This activity is only performed when the user asks, but it must still happen reasonably quickly. I am currently using indexOf on the BODY tag's innerHTML element, but am finding it too slow to run repeat...

Inserting of file into an html page using Javascript?

I'm currently trying to read text from a file and append it to a element in my html page using the DOM and Javascript. I can't get the text to format though. I've tried using innerHtml but isn't formating at all( no line breaks ). Here is the javascript: http = new XMLHttpRequest(); http.open("GET",FILE,false); http.send(); documen...

scheduling app using constraints for when an event can take place

Ok, what I'm trying to do is build a web app that allows students to visually organize their class calendar using drag and drop. but They have to be able to drag and drop to specific locations (when those classes are available), not just anywhere. This would be a 'fixed week' calendar. I was considering using a table, but was wondering ...

How do you tell if caps lock is on using javascript?

The question title says it all really. One caveat though: I did google it and the best solution I could find was to attach an onkeypress event to every input, then check each time if the letter pressed was uppercase, and if it was, then check if shift was also held down. If it wasn't, therefore caps lock must be on. This feels really dir...

how to create multi select auto complete combobox ??

IN my case i want to implement multi select auto complete combobox using html,javascript,jsp. Is there any body who knows how to implement it. Which will be similar to text field shown in stackoverflow while adding multipal tags to any question. ...

how to check status of checkboxes in gridview columns on click of button

Hi, T have used checkbox column in gridview. On click of a linkbutton, it should be checked that checkboxes in gridview are checked or not. If none check box is checked then it should display alert("Check at leat one check box"). ...