传参给 js

jsp --> js

通过带参函数传递:

jsp:<img src="css/images/date_delete.png"  onclick="firm('<s:property value="ip"/>')"/>

js:  location.href="whiteAction!del.action?ip="+ip;

url -->js

var i = window.location.href.split("=")[1];

java -->js

$.post(url,{params},function(result){});

result即为所传的参数,json类型

 

posted @ 2012-11-01 17:51  墙头一颗草  Views(115)  Comments(0Edit  收藏  举报