跨国婚姻:javascript 问题 为什么两个函数不能共存??

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/27 09:09:48
我有两个函数
1:
function chang_material(text)
{
window.opener.document.getElementById("material_id").value = text;
self.close();
}

2:
function chang_po(text)
{
var index,value
window.opener.document.getElementById("po_id).selectedIndex=index
window.opener.document.getElementById("po_id").focus
self.close();
}

我在 <a href="#" onClick="chang_<%=trim(search_tp)%>('1')"><%
=materialSet("material_id")%></a> 调用
trim(search_tp) 有两个值(material和po) 来控制调用的函数即chang_material() 或 chang_po
问题 如果有chang_po() 就chang_material() (onclick)不能用 请问为什么
备注:函数的功能是 用一个弹出页面 改变另一页面的值

function chang_po(text)
{
var index,value;
window.opener.document.getElementById("po_id).selectedIndex=index;
window.opener.document.getElementById("po_id").focus;
self.close();
}