English 中文(简体)
• 如何只通过火药重载文字
原标题:how to reload only scripts through firebug

我在做很多事情时,ja得.。 我重复的情景是:

  1. load page
  2. change some scripts for that page
  3. reload page with ctrl+f5 and see if it works

我想做的是,只重载整页的文字,因为标识是相同的。 这样做的任何途径?

最佳回答

首先,尝试并尽量减少这种测试。 书写原,DRY代码,并在将它并入现场/网页之前进行单位测试。 你们可以在青.的 con子里迅速这样做。

Next, if the JS that you are reloading sets intervals or event listeners, then you will want to clear those intervals and unbind those listeners before reloading the JS under test. That means that anonymous intervals and event handlers are forbidden.

创建一份联合文件,必要时使用clearInterval(),removeEventListener(.unbind()。

之后,你可以在火焰虫中操作这样的法规:

function addJS_Node (text, s_URL)
{
    var scriptNode                      = document.createElement ( script );
    scriptNode.type                     = "text/javascript";

    if (text)  scriptNode.textContent   = text;
    if (s_URL) scriptNode.src           = s_URL;

    document.head.appendChild (scriptNode);
}

addJS_Node (null,  Path_to_JS/ResetTimersAndEvents.js );

addJS_Node (null,  Path_to_JS/JS_Under_Test.js );
// etc.
问题回答




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

热门标签