javascript

How do I convert a function name into a string

I have a function from an object, lets say Object.MyFunc. I need to send this function name into another function like so: doSomething("Object.MyFunc"); any advise? ...

Blurring fisheye effect on a vertical text menu

I'm searching for existing scripts that will animate a vertical text menu by blurring text and zooming it according to the mouse pointer. I'm trying to accomplish these actions: 1. OS X-like movement on mouse hover that can 'zoom' the text in and out 2. In an un-focused state, the text would be blurred 3. When a user moved their point...

onblur ajax not calling the callback function

I Have the following code which is called inline as below also. The problem is the alert never fires. In firebug i can see that data is filled with my object, but still the alert doesn't fire. Any ideas? function update(s_arrive) { $.post("../base/getDestInfo.asp", { "dest": s_arrive }, function(data) { alert('aa'); }, "json"); } <...

Class method can't access properties

I have created a class like so: function MyClass() { var myInt = 1; } MyClass.prototype.EventHandler = function(e) { alert(this.myInt); } Unfortunately, the this is the triggered event (in my casss an tag), and i can't access the class properties. Any suggestions? ...

YUI: customizing message browser shows when cancelling window close event

I have a YUI application. Under certain circumstances I want to alert the user before he closes the window. Therefore I capture the window close event and do onWindowClose: function(e) { if (...) { YAHOO.util.Event.preventDefault(e); } } The browser shows a standrd message: "Are you sure you want to navigate ...

Does Adobe AIR for JS support some sort of non-persistent data container?

For a project I need to develop an app in Adobe AIR, I choose for the HTML/Ajax version. For now the project is quite small, and contains a login part, and a details part. What I would like to do is on app launch show login.html, and if that was succesfull show/browse-to details.html . My question is if there is some quick and dirty w...

Given the link below how to slide with jQuery.

i have little knowledge about js or jquery, i need your help : Slide Example like that. Given the link below how to slide with jQuery. ...

How i add an addListener to GOOGLE MAPS to get MapType

How i add an addListener to GOOGLE MAPS to get MapType ...

How can I customize this javascript function?

Hi! I have this javascript function that block special characters... function validaTexto(texto) { !(/^[A-zÑñ0-9]*$/i).test(texto.value) ? texto.value = texto.value.replace(/[^A-zÑñ0-9]/ig, '') : null; } The problem is that this function doesn't allow me to type blank spaces... how can I customize this function to allow me some ...

Convert JavaScript links to standard links

Hey, I am working with HTML which has javascript links like below: <a href="javascript:openExternalLink(5542, true, 'http://www.websitedomain.com')"&gt;Links Text Here</a> I need to replace these with standard anchor tags like so: <a href="http://www.websitedomain.com"&gt;Links Text Here</a> What would be the best solution to achi...

Javascript Event Hierarchy in Prototype framework

Hi there, is there any event to be handled between the dom:loaded and load using Prototype javascript framework? I've implemented a preloader using prototype which is looking like this: Event.observe(window,"load",preload); function preload(){ if($('wrapper')) $('wrapper').setStyle({"display":"block"}); if($('loading')) ...

How to bind ASP.NET Treeview control to a datatable?

I have this table structure: - CategoryID - CategoryName - ParentID I want to load data from this table into a treeview control, to be able to edit/delete these records. How to do that? ...

Is variable updated "by reference"?

Hi all, I have the following simple script. <script> SPC = { a : [10], b : 10, t: function() { y = this.a; z = this.b; y[0]++; z++; alert('this.a[0] = ' + this.a[0] + '\nthis.b = ' + this.b) } } SPC.t(); SPC.t(); </script> Running it in your browser will display two alert ...

Dynamic height of iframe

I am currently working on an existing site that uses iframes(sigh!), these are pretty painful to work with and I'm having problems getting the height of the iframe to scale with the height of the HTML content. I've tried a few different script snippets that floats around on the interwebs, but none of them have worked for me. I really wa...

Looping through all select elements with JavaScript Prototype library

How can I (if it is possible) use the Prototype library to loop through all select elements on a page and access the element? In the documentation I found easily shortcuts for referencing elements with certain ids, class names etc. but no reference for elements with certain tag names. If this is not possible with Prototype, an example w...

ASP.NET MVC including ASP in Javascript

Hi, Is it possible to put ASp.NET tags in my javascript which is in a seperate script file. For example, I have the following $.getJSON("/Postcode/GetAddressResults/" + $get("SearchPostcode").value, null, function(data) { which I want to turn into but it does not like the ASP tags! var action = "<%=Url.Content('~/Postcode/GetAddr...

Scriptaculous load parameter in FF 2.0.x

Greetings all, I am attempting to explicitly load the effects.js and builder.js Scriptaculous libraries on a page, using this code: <script type="text/javascript" src="/javascripts/scriptaculous.js?load=builder,effects"></script> This works like a charm in FF 3.0.x, IE7 and Opera 9.6.x. It does not work in Firefox 2.0.x, however. The...

Get control properties with javascript in firefox

I'm trying to access control's properties and although it works great in IE6, in FF3, it fails. Im doing: alert(document.getElementById(gridViewCtlId).style.display); alert(document.getElementById(gridViewCtlId).style); And the first one shows a blank popup while the second shows 'undefined'. I do alert(document.getElementById...

ASP.Net Master Page and File path issues

I'm trying to add a script reference to jQuery in my master page so that it will work for any page. It currently looks like this <script type="text/javascript" src="jquery.js"></script> The problem is that the path is always relative to the executing aspx page so this will only work if the "jquery.js" file is located in the same folde...

Send a web page through javascript

Hi friends, I want to email a web page through javascript. Its enough to open the outlook new mail option. I try to move a Here i am using mailto: option in html. Actually i am try to create a dynamic email template and want to send that template in html format. Its showing error "comment line argument is not valid. verify the switch ...