English 中文(简体)
我能否行使 Java本功能?
原标题:Can I run a JavaScript function AFTER Google Loader has run?

我正在用<条码>google.load(<><>>>>/code>装载谷物,我需要处理其中的一些内容,但我需要在已完全装满负荷后操作 Java版,是否有办法确保做到这一点?

这里是我如何构建图像清单,我需要加上每个图像的特性<代码>img。 但是,在建立之后,这怎么办?

google.load("feeds", "1");

function initialize() {
    var feed = new google.feeds.Feed("myfeed.rss");

    feed.load(function(result) {
        if (!result.error) {             

            var container = document.getElementById("feed");

            for (var i = 0; i < result.feed.entries.length; i++) {               

               var entry = result.feed.entries[i];

               var entryTitle = entry.title;
               var entryContent = entry.content;

               imgContent = entryContent + "<p>"+entryTitle+"</p>";

               var div = document.createElement("div");
               div.className = "image";               

               div.innerHTML = imgContent;

               container.appendChild(div);
           }
       }
   });
}

google.setOnLoadCallback(initialize);
最佳回答

这样做的一个简单办法是在上设立匿名职能。 同样:

google.setOnLoadCallback(function(){

    //Run the Initialize Function
    initialize(function(){
         //Run anything else here like
         alert("My function can run here :)")  
    });
});

并且只是修改了您的初始职能。

function initialize(){ >startize(questback){,使你无法以匿名身份通过。

可在<条码>封顶(功能(性能){}内;上填写,仅能打上<条码>查询(<>),以启动你的呼唤。


你说匿名功能使你感到困惑, 我首先要向您介绍一下写一份职务的几种方式。

  • function hello(){}
  • hello = function(){}

以上是非匿名职能

匿名职能不是分配给变数的职能,因此,传票人接管职能,不执行。

alert("Start")
function()
{
    alert("Middle")
}
alert("End");

上面的行文将显示开始和结束辩词,但中东将永远不会表现出来,因为这一功能尚未履行。

职能如下:

( F )( P )

如果F是匿名职能,PIs是应当属于范围,则你可以直接履行匿名职能,而无需将职能分配到一个可变的谎言中:

alert("Start")
(
    function(Doc){
        alert("Middle");
    }
)(document)
alert("End")

www.un.org/spanish/ecosoc 进入匿名功能并成为匿名功能 在上述范围内,“开始、中和结束一切”都将在你履行匿名职能时执行

因此,我也许会把这一解释推向上,这样就很快地告诉你,原始方法是如何运作的。

Ajax是顺便提一句的意思,即当你打电话的服务器,如 go,要求某些信息时,你的javascript将继续执行,这意味着在等待数据时,你手脚就执行。

正因为如此,我们像“<条码>”这样的呼吁,即:在获得数据时,奥古林·贾瓦特图书馆会执行这项呼吁,而当我们想要的时候,我们就建立了自己的并正在执行。

问题回答




相关问题
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.

热门标签