<iframe id=web></iframe>
<script>
function window.onload(){
web.document.designMode='on';web.document.open();web.document.clear();web.document.write(" ");
}
function document.onclick(){
temp1=web.document.images.length
web.focus();web.document.execCommand("InsertImage","abc","url") //这个是弹出对话框的
if(temp1<web.document.images.length){ //如果插入之后比插入之前,多了一个图片对象则
alert(web.document.images[web.document.images.length-1].outerHTML)
}
}
</script>下面还有一个例子<iframe id=web></iframe>
<script>
function window.onload(){
web.document.designMode='on';web.document.open();web.document.clear();web.document.write(" ");
}
function document.onclick(){
web.focus();web.document.execCommand("InsertImage","","url") //这个是不弹出对话框的
alert(web.document.images[web.document.images.length-1].outerHTML) //不需要检索,直接得到最后一个图片对象
}
}
</script>
<script>
function window.onload(){
web.document.designMode='on';web.document.open();web.document.clear();web.document.write(" ");
}
function document.onclick(){
temp1=web.document.images.length
web.focus();web.document.execCommand("InsertImage","abc","url") //这个是弹出对话框的
if(temp1<web.document.images.length){ //如果插入之后比插入之前,多了一个图片对象则
alert(web.document.images[web.document.images.length-1].outerHTML)
}
}
</script>下面还有一个例子<iframe id=web></iframe>
<script>
function window.onload(){
web.document.designMode='on';web.document.open();web.document.clear();web.document.write(" ");
}
function document.onclick(){
web.focus();web.document.execCommand("InsertImage","","url") //这个是不弹出对话框的
alert(web.document.images[web.document.images.length-1].outerHTML) //不需要检索,直接得到最后一个图片对象
}
}
</script>
for(var i=0,i<a.length;i++){
alert(a[i].src) //遍历iframe中的所有图片
}
alert(a[i].src) //遍历iframe中的所有图片 ,的作用是什么??
if(a[i].src=="你新插入的图片的连接")
{
alert("这就是你新插入的图片")
} }
if(a[i].src="url")
{
a[i].focus();
alert("这就是你新插入的图片")
} }