javascript

How can i make a friendfeed like window scroll control system?

When you active real-time updates, new entries dynamically adding a div. At this stage scroll is automatically moving. This action provides the content you do not miss on visible area. If you want to see this action, you can also watch this screencast; http://www.viddler.com/explore/itod/videos/45/ My method; // Firstly, i am ...

jQuery watch for domElement changes?

I have an ajax callback which injects html markup into a footer div. What I can't figure out is how to create a way to monitor the div for when it's contents change. Placing the layout logic I'm trying to create in the callback isn't an option as each method (callback and my layout div handler) shouldn't know about the other. Ideally I...

page loading in asp.net

Hey, I created a ASP.NET regular project, and I am trying to attach an on click event to 'btn1'. and I have few issues - function pageLoad -> don't working for checking if the dom is ready $addHandler,$get intellisense don`t work how I can fix it? EDIT : And I don`t have intellisense for Sys variable. ...

Disabling browser print options (headers, footers, margins) from page?

I have seen this question asked in a couple of different ways on SO and several other websites, but most of them are either too specific or out-of-date. I'm hoping someone can provide a definitive answer here without pandering to speculation. Is there a way, either with CSS or javascript, to change the default printer settings when some...

eclipse/netbeans: categorize/collapsing code?

is there someway you can categorize the code your are writing in these two programs. eg. if you have a function you can click the - sign on the left and it will collapse the function. but if i want to collapse a section of codes with some functions and procedural code, how can i do that? then you can have different "chapters" like in W...

how to insert a tr which is deleted from another table using jquery and ajax

I know how to remove a tr from the table1 on click of delete. But i want to insert it in to another table . How to do that? here is the code i used to remove the tr. <script languge="javascript" type="text/javascript"> $(document).ready(function() { $('a.delete').click(function(e) { e.preventDefault(); //Getting the TR to remov...

Getting value GET OR POST variable using JavaScript?

How to get value of the get or post variable on page load using JavaScript? ...

get center of width in all browsers with jquery

i have following code to get center of width function alertSize() { var myWidth = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in ...

Javascript classes and jQuery event listeners

Hi there, I'm writing a class that needs to attach event listeners to objects within a respective sections (#one and #two in this example), but I'm having issues passing variables from the class to set up the jQuery event listeners. <script type="text/javascript"> function myClass(id) { this.id = id; $(document).ready(funct...

log errors with stack trace in javascript

I'm trying to log javascript errors on a productive site. So far it worked quite well with the following code included in the site: function catcherr(errorMessage, url, line) { var parameters = "msg=" + escape(errorMessage) + "&url=" + escape(url) + "&line=" + escape(line); new Image().src = "/error.gif?...

Resize an element with overflow:auto taking scrollbars into account

I need to make an image viewer: on the left there's a resizeable TD with the div and image/video. In the right TD there are comments. Images are resized so that those panoramic, with high aspect ratios, were viewable with a scroll bar (horizontal or vertical), but scroll bars were shown only when necessary. The issue is how to calculate ...

Generate well formatted JavaScript

I'm generating huge amount of JavaScript(on server side, ExtJS code) and for debug purposes(mainly,since for production I will -probably - minify the code) it would be nice to have well formatted JavaScript code. Anybody know a library which offer such support? Thanks. Edit 1: What I'm looking for is a Java library which will : lay...

Image uploading using another site's API - Bypassing my server

I want to use imgur's API to upload images however I don't want to use my server too much in the act because I'd like to keep bandwidth to a minimum. The API accepts images in a base64 encoded string or binary. Also if there's a way to encode images into base64 or binary in javascript that would be really useful to know too ...

javascript: get end key value?

how do i get the end key value for a javascript array? i want to compare it with another value. EDIT: and how do you declare a value directly with a declaration of an array. i have to use 2 lines for it. var arrayname = new Array(); arrayname[] = 'value'; could one do that in one line? ...

How to add a new value to the end of an numerical array?

In PHP I can do like: $arrayname[] = 'value'; Then the value will be put in the last numerical key eg. 4 if the 3 keys already exists. In JavaScript I can’t do the same with: arrayname[] = 'value'; How do you do it in JavaScript? ...

Retrieving a closest node to the caret position

I have a document (inside editable iframe), I need to retrieve a closest node to the caret position, not the parent node, but the sibling node (so they must have same parent) that is located (when available) left to the caret position(collapsed selection). The node can be any node, like text node, paragraph, div and etc. Note: the brows...

JavaScript Regex

In a follow-up to this question, I need to compare two strings in a case-insensitive manner, ignoring any non-alphanumeric characters except the comma and the semicolon, in JavaScript. So Times New Roman, Times, Sans-Serif matches Times New Roman,Times,SansSerif Can somebody get me started with the right function/approach? Is there...

javascript: check if array exist, if not create it

how do i check if a specific array exists, and if not it will be created? ...

jquery.val() on the page works, off the page does not? Why?

I had the following: <script type="text/javascript"> var noteid = $('#noteid').val(); </script> <input type="hidden" name="noteid" id="noteid" value="321"> This works great... but now I'm trying to move the JavaScript off the page into a linked JS file like so: <script type="text/javascript" src="/js/note_beta.js"> </script> <input...

Problem loading extjs radiogroup data

How do you load data for a radiogroup in extjs, such that the correct radios are checked? On the extjs radio/checkbox example page you will find code like this { xtype: 'radiogroup', fieldLabel: 'Auto Layout', items: [ {boxLabel: 'Item 1', name: 'rb-auto', inputValue: 1}, {boxLabel: 'Item 2', name: 'rb-auto', inputV...