javascript

Overwriting Native Methods in Javascript

I'm doing some analysis of some Javascript and I want to keep javascript enabled, but disable all alert() boxes and self.location redirects. Currently I'm using a regex proxy, but that seems like overkill. I can override some native methods but not others in Firefox i.e. window.alert = function('') { return null; } alert('test!') // w...

How do I call javascript on host MVC page when ajax call in partial view is complete?

I have an Asp.net MVC partial view that is used for searching. It does an Ajax call to retrieve results. Once the results are retrieved and displayed in the result pane, the user can click on a link in any of the result rows to select one of the search results. When the user clicks on a link to select one of the search results, it will m...

How do i get the javascript status of any browser?

hi friends, I want to get the javascript status of any browser. How do i get this.? Means when page load it should display that javascript in that browser is enable or disable. I m using php. Thanks In advance...... ...

What is the best method to detect xml in JavaScript

What is the best method to detect xml in JavaScript e.g. is it possible to detect the mime type of a document - particularly if it is text/xml in JavaScript. this needs to work in Chrome. thanks, Josh ...

JavaScript - OffFocus event?

Hi What I want to do is display an input field with the text color black. Then when the person clicks inside the input field (onfocus) I want to change the text color to red. Then, when the person click outside of the input fied (no longer focus), I want to change the text color back to black. I know how to handle the JavaScript onfo...

What coding conventions that help jQuery and Firebug work together?

I'm fairly new to both tools and need to go hardcore with both as I manage, monitor, and tweak a new site's design process. What sort of strategies should I ask be implemented that sets a good solid foundation for debugging, testing, and logging? [to the degree that back-end stuff can play a role - it's .net mvc thx ...

C# compression and JavaScript decompression

I've got some strings that I need to compress server-side in C#, then decompress client-side in JavaScript. What can I use to accomplish this? ...

Javascript files being truncated

I am using Visual Studio 2008 ASP.NET Development Server and EPiServer CMS, FF3 and IE7 Edited Question - Removed irelevant distractions as I now realise it has nothing to do with dynamic content. Every so often javascript files I am working on are not getting fully downloaded. The file I am currently having a problem with is only 49 l...

Javascript synchronization methods

Hello, I am developing a simple web app that uses the Google translation API in order to translate a text into different languages and then back to the first one. The problem is that when I call google.language.translate(...) a callback function is specified which updates a textarea in my page. Here: while (i < translationNumber) { g...

How do I create a separator between two DIVs with Prototype

http://img197.imageshack.us/img197/9084/seperator.png How do I create a separator, such as Google Docs in the image above, using prototype? ...

how can change value of a div

"<div id="diva">this is div a</div>" "<div id="divb"> this is div b</div>" now how can I change the text of div dynamically by button click. here also mention that all text come from a database. when I click the button then it detects the div id and replace the text with desire text. All code will be in PHP. ...

Increase/Decrease Font Size Script - How Add Default Text Size Function?

Hello, Does anybody know how to modify the below script so that, in addition to the two current functions (changeFontSize( id, true); //Increases the font size - changeFontSize( id ); // Decreases size), I can add a third function whereby the font size will be reset to a default setting? Thank you, Chris SCRIPT function changeFontSiz...

JQuery and validate plugin - how to add a promotional message on submit

I need to put a promotional message either at the bottom of the form or in an alert when a user meets certain criteria. I think an alert might be best. It's to do with certain postcodes so I will need to write a regex (I haven't done this yet). It needs to happen when the user clicks submit and before it goes to the server. I'm not sure ...

How to get the value of a datetime_select field with javascript in ruby on rails

Hi, I had a previous question that touched this topic (http://stackoverflow.com/questions/1131694/rails-how-to-get-value-from-another-field-when-executing-an-onchange-remote-func), but then I dugg a little deeper and realized that my problem is the datetime_select method. I have a textfield with onchange. In the onchange I need to get ...

What are the patterns in html/javascript RIA development?

When building big GUI based applications in other languages like C# or Java, we have various patterns like MVP, MVC, MVVM, and even complete guidance packages like Prism (WPF/Silerlight) that help us keep our code maintainable, extendable and keep the complexity of the application at a sane level. But when it comes to big RIA applicati...

debugging javascript in php applications using visual studio

i have installed wamp server and vsphp and my development environment is Visual Studio 2008. I was easily able to debug java script by turning on script debugging in IE, however now i have a java script which calls a php script and processes it's output, i want to know how in visual studio can i do that, so that it can execute php code b...

Javascript proxy-pattern problem.

Hi! I have something like that: // original function Foo = function(params) { do foo... } Foo.prototype.alert = function() { alert('foo'); } Now i want to interfere: Bar = Foo; Foo = function(params) { do bar... return Foo(params); } Or the JQuery way: (function() { var proxied = Foo; Foo = function() { do bar... ...

Javascript Match and RegExp Issue -- Strange Behavior

I have been trying to use a simple jQuery operation to dynamically match and store all anchor tags and their texts on the page. But I have found a weird behavior. When you are using match() or exec(), if you designate the needle as a separate RegExp object or a pattern variable, then your query matches only one instance among dozens in t...

Javascript interaction between ASP.NET web controls

I have a UserControl A which contains a dropdown a placeholder At runtime the placeholder will be populated with some UserControl B. There are certain times which I need to trap the javascript onchange event in the dropdown to call a javacript function in B (to do a clientside update of B). What is a good design/practice for how to...

Determine the 'Overtype' mode using Javascript

We are creating a web app to replace an old-school green-screen application. In the green-screen app, as the user presses the Insert key to switch between overtype and insert modes, the cursor changes to indicate which input mode the user is currently in. In IE (which is the official browser of the company), overtype mode also works, but...