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()”更具描述性的名称。

更多相关文章

  1. 名称`posix`在何处/如何通过import语句解析?
  2. Python NameError:全局名称“Form”没有定义pyqt
  3. Python(名称空间、函数嵌套、函数对象)
  4. python 简单图像处理(2) 镜像
  5. caffe python批量抽取图像特征
  6. 在Python中显示来自控制台的图像
  7. Python为8bit深度图像应用color map
  8. Tensorflow:恢复图形和模型,然后在单个图像上运行评估
  9. python的PIL绘制多行文本的图像。

随机推荐

  1. android 自定义progressbar 样式
  2. Failed to load libGL.so in android
  3. android 制作输入法
  4. Android Studio使用总结
  5. android 应用在启动后进行全局的的初始化
  6. Android实现签名涂鸦手写板
  7. android webview 设置
  8. AndroidStudio打包apk出现的问题 `Error:
  9. react-native开发实例之替换默认logo——
  10. textview scroll