javascript

How can I open a non-resizable popup at a fixed position?

See title. Using either javascript or pure HTML. ...

Visual Studio 2008 & Override LanguageService for Existing File Extension

Hi, I write simple LanguageService for JavaScript language. Target IDE is Visual Studio 2008. I want to run my LanguageService for .js extension file(default extension for JavaScript language). But for this extension my LanguageService don't working. When I run my LanguageService for extension .jsp(could be any extension don't supportin...

How can I run some javascript after an update panel refreshes?

I have a pageLoad function which sets some css on an .ascx control that I cannot change. On page load everything is fine, but when an update panel updates the control, my css is no longer applied. How can I rerun my function after the page updates? $(function() { $("textarea").attr("cols", "30"); $("input.tbMarker").css...

https javascript and firefox

Hi all, I have some javascript which calls some php functions to track webstats (piwik.org) Everything works fine on http sites, from every browser it is all tracked I have one site that is https - it will track visits from ie, but not from Firefox or Chrome Does anyone know of anything I need to do or set or use to make it work on ...

How can I pass a parameter to a setTimeout() callback?

I have some JavaScript code that looks like: function statechangedPostQuestion() { //alert("statechangedPostQuestion"); if (xmlhttp.readyState==4) { var topicId = xmlhttp.responseText; setTimeout("postinsql(topicId)",4000); } } function postinsql(topicId) { //alert(topicId); } I get a error that topicId is not defin...

Creating a document fragment in YUI 2.x

Is it possible to create a document fragment from a string and get a reference to it using the YUI 2.x API? If so, how is it done? ...

Comet & PHP: How to use Comet with a PHP Chat System ?

I have to build a simple chat system in PHP using Comet. I don't know what would be the best approach to this project. What is the best technique (cross-browser would be nice) to use, and how to implement it? What libraries can I use that already have comet support. (I don't want to use the Bayeux Protocol) I already have a PHP backen...

Scoping "this" in Javascript (and jQuery.extend)

Sorry if this has been answered, but I couldn't turn up a search for it... a difficult thing to search for, I think! Say I have this: var MyPrototype = function() { this.init(); } $.extend(MyPrototype.prototype, { a: 5, init: function() { var thing = new SomeOtherClass(); thing.meth = this.meth; // thing...

Can compressed javascript be uncompressed

Is it possible to uncompress (if that's the right term even) for code like below? var vote=function(){var k={informModerator:-1,undoMod:0,acceptedByOwner:1,upMod:2,downMod:3,offensive:4,favorite:5,close:6,reopen:7,deletion:10,undeletion:11,spam:12};var f=imagePath+"vote-arrow-down.png";var c=imagePath+"vote-arrow-down-on.png";var x=imag...

Why does Ext JS 3.0 break my grid filter input field?

Here's a snippet of code, inserted immediately after creating my grid, that worked fine under 2.0: var gridFilter = Ext.get(gridToolbar.addDom({ tag: "input", type: "text", size: "25", value: "", cls: "x-grid-filter"}).el); gridFilter.on("focus", function(){this.dom.select();}); Now, I get a JavaScript error on the...

Disable select form field but still send the value.

I have a select form field that I want to mark as "readonly", as in the user cannot modify the value, but the value is still submitted with the form. Using the disabled attribute prevents the user from changing the value, but does not submit the value with the form. The readonly attribute is only available for input and textarea fields...

javascript:history.back() on pages and not events

I have an ASPX page that contains a link to "javascript:history.back()" The problem is that page contains a gridview that changes with events (ex. a column is sorted). Now when I click the link to "javascript:history.back()", it just reverses the event but instead I want to go back to the last page (bypassing all the events). Is there ...

Adding an Ext.Button class into a Box Component

Hello, I'm working with extjs 2.2.1, having a bit of a trouble adding a button into a box component class. From my understanding, because box component extends the component class, it has no config options that allow an item to be added. So the code below does not work... new Ext.Viewport({ layout : 'border', items : [new Ext.Bo...

DWR like Javascript library for REST

Is there a Javascript library like DWR that can generate javascript stub for REST api. We are using Jersey/JSR-311 for REST on server and was wondering that instead of using libraries like Jquery or dojo if there is a library that can take a Rest class annotated using JSR311 annotations and create javascript stub like DWR does? ...

What is the performance impact of adding methods to native JavaScript objects?

I realize that adding methods to native JavaScript objects (Object, Function, Array, String, etc) is considered bad practice by some, but is there also a performance hit associated with this? Would instances of native objects take longer to create and/or use up more memory if their prototype has been extended with additional methods? ...

Prevent table column from being selected and copied in Safari and Firefox?

I'm working on what is basically a small utility that displays a piece of sourcecode in a table which has two columns, one for line numbers and one for the actual source. I found that you can prevent the appearance of text being selected with the following CSS: table th { -moz-user-select: none; -webkit-user-select: none; } Unfortu...

Closing popups on session expiry

Here is the thing : my webapp has loads of popups and my boss wants 'em closed on session expiry, coz when session expires and an user presses refresh on a popup, he is being shown the logon page -> user logs on -> user is directed to the dashboard. Now, a dashboard screen in a popup is totally uncool. Here is where google got me: Have...

free javascript widget to show an organigram chart...

I'm looking for a javascript widget to show some fairly complex graphes... Ideally, it would be interactive, that is the user should be able to move around the nodes, select one or many, zoom in, click on a node to see more info, etc... If it could have printing support, that would be marvelous... The idea is to let the user browse th...

i'm learning javascript and what other levels of it exist out there?

in the beginning i was learning jquery and felt limited because of the lack of knowledge of javascript, so i decided to learn as much as possible. i looked through these subjects and understood them: variables loops functions all the basic stuff that exist in all scripting/programming languages but i didnt get too much info on objects...

wmd - markdown editor - how to assign it to an arbitrary text field?

If any of you have ever used wmd markdown editor (which is like the editor that stackoverflow uses) then maybe you are able to help me out: WMD by default assigns itself to the first textarea found on the page. However, I have a page with an arbitrary amount of textareas appearing before the one I need WMD assigned to. WMD provides o...