javascript

problems with decodeURI with %^ characters

Code: <script type="text/javascript"> var uri**="%^my test**.asp?name=ståle&car=saab"; document.write(decodeURI(uri)); </script> Error: Line: 6 Error: The URI to be decoded is not a valid encoding is there anyway of decoding the combinations like %^ before calling the actual decodeURI ...

How to reverse the effect of the following execution by using Javascript?

javascript:void(document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/; domain=.google.com”); How to eliminate the result of the statement above by writing another Javascript statement? ...

ASP.net Script Service consumption in javascript

I have a script service in asp.net and I need to consume this WS from javascript using JSONP (Script tag injection; since it is cross domain, no $.ajax() call). In this case, where the input to the web method is a complex structure, I have to create the input structure at the client. How does matching of the client-side structure to the...

How to remove a cookie by using Javascript?

How to remove the cookie set by javascript:void(document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0Ys-53ZueXfZG;path=/; domain=.google.com”); The following statement doesn't work. javascript:void(document.cookie=”PREF=ID=20b6e4c2f44943bb:U=4bf292d46faad806:TM=1249677602:LM=1257919388:S=odm0...

Function only works on one div?

I am stuck... I can't seem to get a function to fire off on the divs below the first one.... any suggestions? ...

set a value to a textbox which had focus in javascript

Hai guys, I have three textboxes and one listbox... If the user clicks the first textbox and then click a list item the selected item must be set as value to the textbox... I want this in javascript.... ...

Javascript validation for a dynamic gridview have checkbox

Hi, I have created a GridView Dynamically. This dynamic gridview has two Template Field column. Both the column has checkboxes in every row. How do I write the client side validation so that only one checkbox is checked at a given time in a particular row. I tried using this code but it didn't work function MutExcCheckBox() { ...

Running V8 Javascript Engine Standalone

I want to run a Javascript console on top of V8. How do I do this? ...

Relative script path in usercontrol

Hi, I have asp.net usercontrol that is including some js script like this <script type="text/javascript" language="javascript" src="../JScripts/JScripts.js"/> The problem is that when I am using this usercontrol in some pages, it works correctly, but when using some pages in another folder structure, it fails with the file not found e...

Apparent memory leak in web application (maybe from AJAX?)

Hi all I'm running an AJAX request from a JavaScript-powered (+jQuery) webpage every 5 seconds for a set of JSON data. I left my application on overnight, and by morning my computer had completely frozen. I narrowed it down to my web browser and now, using Google Chrome's Resource Tracker, I can see that each request contributes a new m...

jQuery appendTo listbox not working in IE

Hey folks, I have a listbox containing "all" the items and a second listbox that will contain "selected" items. I want to have it so that double-clicking an item in the "all" listbox adds that item to the "included" listbox. Currently i have : $(document).ready(function() { $('#AllAirlines option').dblclick(AddAirline); } functio...

What is Container-Based Authentication?

I know the "XMLHttpRequest" object supports a method "open" which has an optional parameter of a username and password. I just found out that these parameters can be supplier for requests requiring container-based authentication. This is the method signature: open(method, url, async, username, password) Can someone help me out with t...

I need some critique about lib design

OK. I have this lib for my internal project (function() { var window = this, undefined; //guaranteed undefined var h3 = window.h3 = function (user) { return window.h3 = new h3.prototype.init(user); }; h3.prototype = { init: function(user) { this.timestamp = +new Date; this.user = use...

Is object[0] sort of a default key for an object in JavaScript?

Here's a small JavaScript snippet: var re_words = /\w+/g; var words; while (words = re_words.exec(' here are a few (sic!) words ')) { alert(words); } The loop alerts the words found in the input string, which is what I expected, because all the JavaScript tutorials tell me so. Now, typeof(words) results in object. Ther...

Google Maps centering or marker positioning issue

Hi everyone, I develop a simple Google Maps application. I need just to place one marker on the map. For whatever reason, the marker is placed outside of the visible area of the map. It's a little bit strange, because the map is centered to the marker's coordinates. Here is the code: var point1 = new GLatLng(location1.lat,location1.lon...

Setting onbeforeunload on body element in Chrome and IE using jQuery

I have a system where I want to check with the user if they're sure they want to leave the page once a dirty flag is set. I'm using the following code - In FireFox, I can look at the page source through FireBug and the tag correctly has the onbeforeunload attribute inserted in it. In Chrome and FireFox, this doesn't happen though an...

Javascript textbox autocomplete clears drop down selection

Morning folks. Novice Rich here once again requesting assistance. I have just started dabbling with javascript and although I have set up a few onclick/change for setting the focus of radio buttons,that's pretty much my limit. In my c# code behind, I would like to have an 'onchange' function whereby once a client starts to type in my ...

Overriding a prototype.js method

I'm attempting to override the Form.Element.disable() method in PrototypeJS so that it adds a custom class to disabled form elements. I've added: Form.Element.disable = function(element) { element = $(element); element.blur(); element.disabled = true; element.addClassName("disabled"); return element;} to the page after loading protot...

javascript - know if a link has already been opened.

Hi, I'd like to know if there is a way to know if a link has already been opened. In firefox, the color of a link changes once you clicked it, so I guess it's possible. Edit : This is for a firefox extension, so I can't change the HTML or CSS file. Thanks :) ...

addEventListener and the scope of this

I have a third party flash object which i can manipulate through a javascript API they provided. I am tryind to listen to an event on this object and then fire event inside my object to further bubble up the event. I happen to being using EXT Js but i dont think its important here. Sample code this.chart.addEventListener('create', fu...