English 中文(简体)
为什么在浏览器中展示我网络形象的差异?
原标题:Why the difference in displaying my webcam image across browsers?

我有一个IP网吧,把图像上载到天气服务处。 然后,我在网页上展示这一形象。 为了做到这一点,我寻求一些法典,以更新图像,而不更新网页。 我发现,我修改了一些法典(令我不知道谁承认)。

    <script> 
    var reimg
    window.onload=function () {
    reimg=document.getElementById( re )
    setInterval(function () {
    reimg.src=reimg.src.replace(/?.*/,function () {
    return  ? +new Date()
    })
    },60000)
    }
    </script>

下一个轨道在很大程度上可能是高技能的,但我一直试图让它在所有浏览器上工作(我想看一看)。

    <iframe frameborder=0 marginwidth=0 marginheight=0 border=0 width="360" height="270" style="overflow:
    hidden;border:0;margin:0;width:360px;height:270px;max-width:100%;max-height:100%" 
    src="http://icons.wunderground.com/webcamramdisk/g/l/Gluepack/1/current.jpg?" id="re" scrolling="no"
    allowtransparency="true">If you can see this, your browser doesn t understand IFRAME. However, we ll 
    still <A HREF="http://icons.wunderground.com/webcamramdisk/g/l/Gluepack/1/current.jpg">link</A> 
    you to the file.</iframe>

该公司在Porin做精细工作,将640×480的原形象减少到合适程度。 然而,在IE和Mook,图像的顶端(即图像不会降低到适当)。 是否有必要增加任何法典,以确保它正确显示(即我为什么想要它,如何把它减少到适当程度)的IE和 Chrome,或者是不可能做到的?

问题回答

图像是如何展示的,实际上要看浏览器,就没有标准。 最容易的解决办法是建立一个包含 j和<img>的超文本文档,而不是将图像直接装入机体:

<!DOCTYPE HTML>
<html><head>
<script>
window.onload = function() {
    var reimg = document.getElementsByTagName( img )[0];

    setInterval(function () {
        reimg.src = reimg.src.replace(/?.*/, function () {
            return  ? +new Date()
        });
    }, 60000);
};
</script>
<style type="text/css">
* { margin: 0; padding: 0; }
img { width: 360px; height: 270px; }
</head><body>
    <img src="http://icons.wunderground.com/webcamramdisk/g/l/Gluepack/1/current.jpg?">
</body></html>

将“网络”改为“网络”。

<iframe frameborder=0 marginwidth=0 marginheight=0 border=0
width="360" height="270" style="overflow: hidden; border:0; 
margin:0; width:360px; height:270px; max-width:100%; max-height:100%" 
src="webcam.html" id="re" scrolling="no"
allowtransparency="true">...</iframe>




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签