-
type mismatch javascript
hello, i have this functions in a asp.net page:
function localizaElemento(name)
{
var elemento;
if(document.getElementById)
elemento=document.getElementById(name);
else if (document.all)
elemento=document.all[name];
else if (document.layers)
{
for(var i=0;i<document.forms[0].length;i++){
if(document.forms[0].elements[i].name==name){
elemento=document.forms[0].elements[i];
break;
}
}
}
return elemento;
}
function addEvent(obj, evType, fn){
if (obj.addEventListener)
obj.addEventListener(evType, fn, true)
if (obj.attachEvent)
obj.attachEvent("on"+evType, fn)
}
function setEvent(evt,func){
var mapa=localizaElemento("inmap");
addEvent(mapa, evt, func);
}
function ferramenta(f){
var tool=localizaElemento("tool");
tool.value=f;
}
then i have this:
<td class="tool" ><img src="images/ToolCenter.png" onclick="setEvent('click',ferramenta('centrar'))" /></td>
this will add an event to an input tag named mapa, this works fine but one javascript erro appears : Type Mismatch i think in this line function setEvent(evt,func)..
this only occurs in IE in firefox no
Can anyone help me??
Thanks a lot
Similar Threads
-
By Stuart Crow in forum Database
Replies: 1
Last Post: 11-26-2001, 09:26 AM
-
Replies: 1
Last Post: 11-20-2001, 12:14 AM
-
By Maria in forum VB Classic
Replies: 0
Last Post: 05-01-2001, 06:01 PM
-
By Tahui in forum VB Classic
Replies: 2
Last Post: 11-22-2000, 10:24 PM
-
By Cindy in forum VB Classic
Replies: 3
Last Post: 05-02-2000, 02:57 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks