---
title: "javascript回调参数传递"
author: "hain"
date: "2010-01-20T15:09:48Z"
tags: []
categories: ["Web前端"]
slug: "javascript"
draft: false
lastmod: "2010-01-20T15:09:48Z"
id: 575656
url: "https://hain.iteye.com/blog/575656"
---

div.onclick=new Function("x","return function(){showDetail(x)}")(this.latlng)

 

在javascript中给div对象定义onclick事件的函数，后面是一个回调，开始用：div.onclick=showDetail(this.latlng)等好几种方法都失效，用最上面一个ok