开发者

How to send parameter?

How开发者_JAVA百科 can I send image path to the function? My code is:

<a href="#" onclick="addElement(this.id);" id="cricket" tabindex="1">Cricket</a> 

I want to send my image path in the function addElement along with the id.


addElement(this.id, this.getAttribute('href'));


How the image path may be, are you defined the image path?

if you defined the image path, can workout like that

  <a href="#" onclick="addElement(this.id,'<?php echo "images/img.gif";?>');" id="cricket" tabindex="1">Cricket</a>


I see what you're trying to do, but no, it is impossible to show an image in an alert window, the funcion window.alert() won't allow it in any possible way but not all is lost, if you wish to explore some alternatives you can try this link http://code.google.com/p/submodal/ which is a way to do something similar to what you seem to need, or you can try to use CSS to accomplish it if you're just trying to show an image.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜