Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用JQuery更改iframe上的图像_Javascript_Jquery_Html_Iframe - Fatal编程技术网

Javascript 使用JQuery更改iframe上的图像

Javascript 使用JQuery更改iframe上的图像,javascript,jquery,html,iframe,Javascript,Jquery,Html,Iframe,我需要用jQuery更改一个图像,当我点击我的网页图像时,我需要该页面显示一个提示、警报。。。或者类似于我放置新图像的新路径的地方 有人知道吗 我用Jquery显示我的代码,在那里我更改了段落和标题,我需要类似的,但用于图像 $("#probando").contents().find("#cabecera1").click(function () { var nuevoTexto = prompt("Introduzca el nuevo contenido"); $("#pr

我需要用jQuery更改一个图像,当我点击我的网页图像时,我需要该页面显示一个提示、警报。。。或者类似于我放置新图像的新路径的地方

有人知道吗

我用Jquery显示我的代码,在那里我更改了段落和标题,我需要类似的,但用于图像

$("#probando").contents().find("#cabecera1").click(function () {
    var nuevoTexto = prompt("Introduzca el nuevo contenido");
    $("#probando").contents().find("#cabecera1").text(nuevoTexto);
});
需要更改的图像位于帧中

<iframe id="probando" src="prueba2.html" scrolling="auto" height="700" width="750" marginheight="0" marginwidth="0" name="probando"></iframe>


伊夫拉梅皮
$(函数(){
变量f=$(“#foo”)
f、 加载(函数(){
f、 contents().find('div').hide();
})
})

我不明白的事情: 您必须单击帧中的图像,当您单击时,会出现一个提示为图像写入新路径。当提示提交时,src的图像会发生变化,是吗

在这种情况下,您可以直接在框架的包含页面上编写代码

$().ready(function() {
  $('#imageId').click(function() {
    var newPath = prompt('Please enter new path for image :');
    $(this).attr('src',newPath);
  });
});

如果不是这样,请解释结构和位置=)

我需要的是我将放置新图像路径并直接更改它的内容。非常感谢谢谢这是我需要的!!
$().ready(function() {
  $('#imageId').click(function() {
    var newPath = prompt('Please enter new path for image :');
    $(this).attr('src',newPath);
  });
});