javascript

Javascript's Date.getTimezoneOffset()

I'm trying to compare a GMT time offset from the operating system to a GMT time offset from Javascript's Date.getTimezoneOffset(). The problem is windows gives an offset based on EST while javascript gives an offset based on EDT. There is an hour difference between these two. Does anyone know how to make Javascript use the Standard Times...

Create row ID for dynamic JS Table

Hi, I have working script that the user completes inputs on a form and when they submit the form and the content of the form inputs are entered as a table row. Is there any way of, I think within the JS to make each row have a unique ID and add a delete button to the last colum of each row so the user can delete an individual row. T...

Alternative to query string and cookies when sending data to server?

I have a small (or perhaps not so small) issue with some ASP.NET/Castle Monorail sites for a product I work on. This is a fairly legacy system (written well before my time), and it uses GET requests with a considerable amount of information in the query string. We have recently run into query string length limitations, and for the amount...

ASP.NET AJAX Server Control - Detecting Instantiation of Control

I am creating a custom .NET AJAX Server Control, and need to get access to the JavaScript object functionality associated with that control. I can do this by finding the control in the ScriptManager using the $find method. However, I need to determine when I can call $find. If I do this on the "onload" event of the body of my HTML page...

Media Player <object> - catch mouse events

I'm trying to catch mouse events on my media player within javascript but no success. I also enabled 'SendMouseClickEvents' but still nothing. <object click="das();" id="Player' + j +'" width="160" height="120" '; s +=' classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '; s ...

Ajax, back button and DOM updates

If javascript modifies DOM in page A, user navigates to page B and then hits back button to get back to the page A. All modifications to DOM of page A are lost and user is presented with version that was originally retrieved from the server. It works that way on stackoverflow, reddit and many other popular websites. (try to add test com...

Zend_Progressbar + JQuery + uploading a video

I would like to show a dynamic progressbar in my applciation while uploading a video (*.flv format). I searched on the Web for more than 2 hours but I can't find any tutorial to guide me through this process. What I have so far: script that uploads a video jQuery library included in the section But what to do next? Here is the cont...

Regex for alphanumeric password, with at least 1 number and character

Need help with a regex for alphanumeric password, with at least 1 number and character, and the length must be between 8-20 characters. I have this but doesn't seem to be working (it doesn't have length requirements either): ^[A-Za-z0-9]*[A-Za-z][A-Za-z0-9]*$ ...

how can one "unstyle" a div html element?

Is there a simple way via CSS or javascript or anything really to take a div and make it not inherit any styles? I'm creating a bookmarklet which adds a header to a website. It modifies the DOM as follows: var bodycontent = document.body.innerHTML; document.body.innerHTML = ''; var header = document.createElement('div'); var bodyconta...

IE6 is not updating the style once a class is removed from an element.

Hi, I'm building a website and i'm trying to get it to display correctly under IE6 and as you might guess, it's a lot of work. I have this CSS style : table.tasks > tbody > tr.finished> td.description { text-decoration: line-through; } And this html code : <table> <tbody> <tr> <td class="description">Blah</td> </t...

Javascript Menu OnBlur Issue

So I'm creating a javascript menu and trying to implement an onblur event for when a user clicks something outside the menu so it will collaspe. To implement this, I simply attached an event to the window and looked for any clicks and if it nor its parents elements didn't meet a certain criteria then I would close the menu. This works ...

Jquery: Doing some operations on strings

I have a string like this: Heading Some interesting text here HeadingSome interesting text hereHeading Some interesting text here Heading Some interesting text here What I want to do, is to add another heading under the third heading so it would end up looking like this: Heading Some interesting text here HeadingSome interesting text...

Javascript errors / bad practice

Is it bad practice to have a single javascript file that gets loaded accross all pages even if certain functions are only needed on certain pages? Or should the files be split up according to functionality on a given page and loaded only by pages that need them? ...

Automatic translation of C# enum to JavaScript

I have a flags enumeration in a .NET assembly that is getting called from an ASP.NET page. I want to have a Visual Studio build step generate a .js file that has the JavaScript equivalent in it. Are there any tools for doing this? edit: This seems to work. public class JavaScriptReflection { public static string Go(Type type) ...

Integrate 3rd Party Flash Component into an Adobe Air Application?

I'm fairly proficient with HTML/Javascript/CSS. It's my understanding that I can write an Adobe Air application using just those technologies. Let's assume I want to convert one of my webapps to an Adobe Air application, but this web app uses a 3rd party Flash component. Can I embed this 3rd party flash component into my Adobe Air applic...

WMD markdown editor - HTML to Markdown conversion

I am using wmd markdown editor on a project and had a question: When I post the form containing the markdown text area, it (as expected) posts html to the server. However, say upon server-side validation something fails and I need to send the user back to edit their entry, is there anyway to refill the textarea with just the markdown a...

Rails ActiveRecord BigNum to JSON

Hi, I am serializing an ActiveRecord model in rails 2.3.2 to_json and have noticed that BigNum values are serialized to JSON without quotes, however, javascript uses 64 bits to represent large numbers and only ~52(?) of those bits are available for the integer part, the rest are for the exponent. So my 17 digit numbers become rounded o...

Is there a good wrapper for using Media Player in IE

I need to add media playback ability to a web application. It has to play audio and video, and the player has to be MS Media Player (shouldn't use any plugin non existent on a standard windows machine). I know I can add it directly as an ActiveX to IE, and control it with JavaScript. I wonder if there is some popular and good wrapper tha...

How do I dynamically add points to a Google Map when the bounds change?

I can currently place static points in the map window: var latlng = new GLatLng(lat, lng); map.addOverlay(new GMarker(latlng, markerOptions)); And I know how to get the bounds of the window. I can also code a page that will take the bounds and return the points that are inside them in any format. The problems I have now: Does the ...

Running JavaScript in a UIWebView before any other JavaScript is run

I have a UIWebView component that is going to load a webpage which might contain JavaScript. I want to run some JavaScript of my own before any JavaScript on the loaded webpage runs. I know I can use [myWebView stringByEvaulatingJavaScriptFromString:] on the webViewDidFinishLoad: delegate of the UIWebView, however this will only run my J...