Javascript来自数据库的图像上的图像映射
I call an image using the displayMainImage.php link below and that works fine, it pulls the image name from a mysql database. I am now trying to connect an image map to the image, that part isn't working. Is this possible and if so how. The below code is in javascript running on a php site.
我使用下面的displayMainImage.php链接调用图像,并且工作正常,它从mysql数据库中提取图像名称。我现在正在尝试将图像映射连接到图像,该部分不起作用。这是可能的,如果是这样的话。下面的代码是在php网站上运行的javascript。
<?php echo '
<script language="javascript">
function openit() {
newWindow = window.open(\'http://www.mysite.com/front_page/\', \'dfac\', \'width=900,height=700\');
}
</script>
'; ?> <br/>
<script language="JavaScript" type="text/javascript"
src="http://www.mysite.com/idevaffiliate/displayMainImage.php?token=logo" usemap="#Map">
<map name="Map" id="Map">
<area shape="rect" coords="175,247,366,280" href="javascript:openit();" />
</map>
1 个解决方案
#1
Yes, it's possible. Is the following missing open tag a typo?
是的,这是可能的。以下缺少开放标签是错字吗?
area shape="rect" coords="175,247,366,280" href="javascript:openit();" />
Should be:
<area shape="rect" coords="175,247,366,280" href="javascript:openit();" />
The "usemap" attribute should be on the "img" element, not on a script tag.
“usemap”属性应位于“img”元素上,而不应位于脚本标记上。
On another note, the function should have a more descriptive name than "openit()".
另一方面,该函数应具有比“openit()”更具描述性的名称。
更多相关文章
- 名称`posix`在何处/如何通过import语句解析?
- Python NameError:全局名称“Form”没有定义pyqt
- Python(名称空间、函数嵌套、函数对象)
- python 简单图像处理(2) 镜像
- caffe python批量抽取图像特征
- 在Python中显示来自控制台的图像
- Python为8bit深度图像应用color map
- Tensorflow:恢复图形和模型,然后在单个图像上运行评估
- python的PIL绘制多行文本的图像。