javascript

Paste an image from clipboard using java script

Hi all, How do we paste an image from clipboard into a custom rich text editor using javascript? (ctrl+c and ctrl+v or a snapshot). Has anyone used Ajax's rich text editor? Does pasting an image from clipboard to Ajax RTE work? Please do share your thoughts! Thanks! ...

Emulating Excel's "freeze cells" in an HTML table

I have an HTML table that contains a large number of rows and columns. The top row contains headers, and the first cell in every row below that contains a header. I need to allow the user to scroll the table whilst keeping the top row and left column visible at all times (similar to what can be achieved using the "freeze cells" option i...

Getting the img tag inside iframe

I have an iframe with a class name="blaclass". Inside it, I have one div with no name (or id) and inside this id there is a div with class name = "classs". Inside this div, lie two images (with no class name/id). How can I get those image.src? If there is a Prototype version even better! PS: I cannot add class names/ids before the pag...

checkbox select/deselect in repeater when click on text (jquery)

say we have simple asp.net repeater, in a row we have one checkbox, one label (database-id of the record) and not visible (used for postback) and one text (in a tabelcell) now i want to make it like in windows, if you click on the text, the checkbox should be selected or deselected. has somebody a link or solution for this, maybe alre...

java/greasemonkey, how can i take an image and find the darkest pixel then click it?

yeah i need to use a grease monkey script to find the darkest pixel in an image and then click the point it finds. im kinda a noob programmer so any help would be awesome, thanks! ...

Is there a way to get a non-node result from MSXML XPath evaluator?

I understand that the name of selectNode/selectSingleNode methods actually suggests that they are designed to return a node, however maybe there is some other way or a setting available to enable XPath evaluator to return data of other types (that are also valid XPath results) oDocument.selectSingleNode("'1'"); throws an error "Expr...

What do I need to do to get a JS3 environment (or at least couchdb) up and running?

I'm primarily a front-end coder but I'm not a stranger to server-side programming or the command line. Regardless I've still got a lot to learn about setting up servers and whatnot so I was wondering if anyone could help me put together some steps for setting up CouchDB on (preferably) ubuntu. That's my main goal but I'd also like to ge...

How to select a TreeNode by Javascript?

Hi all. I've a TreeView that displays hierarchical data, while I select a TreeNode, I generate a series of links that map the path from selected node till root node Say: Root Node --> ChildNode --> SelectedNode What I need is, while clicking any of these links, select required node in TreeView? I know that selecting a TreeNode is d...

How to use jQuery in Firefox Extension

I want to use jQuery inside a firefox extension, I imported the library in the xul file like this: <script type="application/x-javascript" src="chrome://myExtension/content/jquery.js"> </script> but the $() function is not recognized in the xul file neither do the jQuery(). I googled about the problem and found some solutions but no ...

Javascript event handlers always increase browser memory usage

Edit: On further examination Firefox does not seem to be doing this, but Chrome definitely does. I guess its just a bug with a new browser - for every event an I/O Read also occurs in Chrome but not in FF. When I load the following page in a browser (I've tested in Chrome and Firefox 3 under Vista) and move the mouse around the memory a...

Cancel jQuery event handling

Hi, I have setup onclick event handeler in the following manner: element.onclick = fuction() { /*code */ } Imagine there are event handlers setup using jquery method bind() or similar handlers. $('element').bind('click', function(){/*another function*/}) How can I prevent invoking handler defined with jquery from the handler I hav...

Risk of using contentEditable in IE

We have to add a basic HTML editor to our product. As we only support IE at present (most customers are still on IE 6), I have been told to use the Internet Explorer built-in XHTML editing capabilities – e.g. <div contentEditable="true"> as explained at "Editing a Web Page" . Apart from not working in other browsers. (The management do...

Event 'load' doesn't work on JavaScript

hi, I try to put an event on document loading but not works... I'd put an alert box, but never seen it... document.addEventListener ("load",initEventHandlers,false); function initEventHandlers () { document.getElementbyId ('croixzoom').addEventListener ('click',fermezoom,false); alert ("Hello, i\'m a eventHAndlers") } function fermez...

Adding to an object in JAVASCRIPT

I have a JSON String that I have converted into an object with: data=eval("(" + jsonString + ")"); I can access all the bits and display them with no issues. The question is how do i add to the object. For example: data.car[0].name = "civic"; data.car[1].name = "s2000"; So, if I have an input box to add a new car, how do I a...

Pure Javascript code for HTTP Basic Authentication?

Where can I find reference code that implements a HTTP Basic Authentication client in pure Javascript, suitable for Ajax? (Yes, I could read the spec and implement it myself, but it's for a side project and I'd rather not spend much time on it.) Extra points for code, or pointers to code, that can be used independent of JS toolkits lik...

Making your javascript maintainable

I am in the process of converting an internal application to use more Ajax via jQuery. I am moving away from the standard code behind of the current ASP.NET application and incorporating JavaScript methods that are going to run client side. My concern is what is the best method for allowing this application to stay maintainable for those...

How can I refresh parent window from an iframe?

I've got a parent page and an iframe inside that page. The links in the parent control the page that gets loaded in the iframe. What I want to do is refresh the parent page when the iframe gets loaded. I've got this in the iframe: RefreshParent(){ parent.location.reload(); } <body onload="RefreshParent();"> But, the above code re...

Getting correct index from input array in JQuery

How do you get the proper index of a selected input from a set of input elements with irregularly numbered indexes using JQuery? JQuery's "index" function always returns a value starting from 0 instead of the indexes I used. My code is below: JQuery: $("input[name^=myboxes]").click(function() { var element_id = $("input[name^=my...

jQuery keypress() event not firing?

I am trying to fire an event on the right and left arrow key presses with jQuery. Using the following code, I can fire events on any of the alphanumeric keys, but the cursor keys (up, down, left, right) fire nothing. I am developing the site primarily for IE users because it is a line of business app. Am I doing something wrong here? $(...

Dynamically loading multiple JS scripts where scripts are all described identically

I have an interesting problem that I'm unsure how best to solve. I have JS scripts which contain the following: var obj = new namespace.MyObjectName("key", [12, 11, 22, 33, 454, 552, 222], [33, 22, 33, 11, 22, 222, 111]); namespace.MyObjectName = function(keyName, data1, data2) { this.myData1 = data1; this.myData2 = data2; ...