javascript

Frameworks for JavaScript UI Widgets?

I'm trying to put together a list of JavaScript UI widget frameworks for consideration in a project. Ideally it would be a library that has a range of ready made ui widgets, no dependencies on dom/js extention/manipulation frameworks like JQuery or Prototype, minimal additional cruft, such as Ajax API's and DOM selectors etc. Here's wha...

How do I suppress window mouse wheel scrolling...?

I'm working on a canvas app embedded in a page. I have it so you can zoom into the drawing with the mousewheel but unfortunately this scrolls the page as it is part of an article. Is it possible to prevent mousewheel scrolling on the window when I'm mousewheeling on a dom element?! ...

Export tables to excel, including a macro

For statistical reasons, I want an extensive analysis from a dataset. I already have a function that exports the data to Excel, but I have raw data that way; 500 lines, 35 columns, heaps of text sometimes... Is it possible to include a macro into a function so that the excelfile is readymade to be analyzed? I am using ASP, Javascript,...

Why does passing ClientID to a javascript function pass the whole control?

If I pass a ClientID to a javascript function as a parameter without including the single quotes around it, it gets passed as a reference to the control itself which can then be used without first calling getElementByID. I can't find this behaviour documented anywhere, is this a browser specific thing or a .net thing or what? I am sett...

Close Parent window in fireFox

Is it possible to close parent window in Firefox 2.0 using JavaScript. I have a parent page which opens another window, i need to close the parent window after say 10 seconds. I have tried Firefox tweaks "dom.allow_scripts_to_close_windows", tried delay but nothing seems to work. Any help will be really appreciated. Thanks ...

html getting garbled from php

Hello, I have a mysql database which as one of the fields contains a html description. This description is not in my control, and is obtained and inserted automatically. An example of one of these descriptions is here: http://www.nomorepasting.com/getpaste.php?pasteid=22492 The data is originally exported from an access database, and ...

How to convert from UTM to LatLng in python or Javascript

I have a bunch of files with coordinates in UTM form. For each coordinate I have easting, northing and zone. I need to convert this to LatLng for use with Google Map API to show the information in a map. I have found some online calculators that does this, but no actual code or libraries. http://trac.osgeo.org/proj4js/ is a projection l...

How do you protect web pages against slow ad tracking web beacons ?

I work for a large website. Our marketing department asks us to add ever more web ad tracking pixels to our pages. I have no problem with tracking the effectiveness of ad campaigns, but the servers serving those pixels can be unreliable. I'm sure most of you have seen web pages that refuse to finish loading because a pixel from yieldmana...

Search and replace

Hi. I'm working on a new project and i want to do something similar (somehow) to intellitext ads (without popup though). In fact, i want to add links on certain words. The problem is that i don't know how to handle this. I mean, ok, i get document.innerHTML then what? I can find any word, but some may be inside of tags. I don't want t...

Set HTML element's style property in javascript

I have a bunch of old classic ASP pages, many of which show database data in tables. None of the pages have any sorting functionality built in: you are at the mercy of whatever ORDER BY clause the original developer saw fit to use. I'm working on a quick fix to tack on sorting via client-side javascript. I have a script already writte...

JS - Advice on how to merge multiple user input to one form field design

I have a page that allows users to enter a lot of information about them (metadata) they can then click on a icon which opens a modal window containing a googlemap which allows them to add locations, and a title for that location. Using mootools I can pass the value of a form field back to the original form, using onclose. The main page...

How to change the value of a Hidden Field in a Gridview using Javascript?

Ok I need to change the value of a hidden field in a gridview and here is what I have so far: for(var i = 0; i < gv_Proofs.rows.length; i++) { var tbl_Cell = gv_Proofs.rows[i].cells[0]; var sdiFound = false; for(var x = 0; x < tbl_Cell.childNodes.length; x++) { if(tbl_Cell.childNodes[x].id == "_ctl0_MasterConten...

Advanced Search Form Validation in asp.net

I'm looking to make validation for a page in which one or more fields have a value in them. I have an advanced search form in asp.net and I'm trying to pop up an error and not post back if all the fields are empty. I've looked into required fields validators but I'm not sure how to make them work together in a AND type fashion instead ...

scope of returned object in javascript function

How do I access 'a' below? var test = function () { return { 'a' : 1, 'b' : this.a + 1 //doesn't work }; }; ...

Modifying form data before submission

I'm using jQuery in conjunction with the form plugin and I'd like to intercept the form data before submission and make changes. The form plugin has a property called beforeSubmit that should do this, but I seem to be having trouble getting the function I specify to run. Here's the markup for the form (some style details omitted): <f...

JavaScript: Scroll Position of div with "overflow: auto"

Given this HTML snippet: <div id="box" style="overflow:auto; width:200px; height:200px; border:1px solid black;"> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br> 21<br>22<br>23<br>24<br>25<br>26<br>27<br>28<br>29<br>30<br> </div> You (usually) get a black box with a scro...

What is the algorithm for storing the pixels in an oval in Javascript?

How would one draw an oval in JS? ...

What is the algorithm for storing the pixels in a spiral in JS?

What is the algorithm for storing the pixels in a spiral in JS? ...

fire silverlight events with javascript

Can I use javascript in a page to cause an event in a silverlight component to fire? If so, does anybody have some code samples? ...

Optimizing deletion of multiple rows in a YUI datatable

Deletion operations seems to be the slowest in a YUI datatable. I have a datatable with > 300 rows. I need to delete selected rows. I tried removing the selected records from the recordset and then calling table.render() .. While this is okay, can it be made better? ...