English 中文(简体)
2. 选择文件内的所有 j变
原标题:Get all javascript variables in document

是否有办法在网页上检索所有 Java字变量?

例如,Pebug能够看到所有联合材料,因此我知道这样做是可能的,但我对如何这样做感到不快。

最佳回答

获取全球变量:

var x=[];
for (var i in window){
    x.push(i)
};
alert(x.join("\"));

储存在窗户中

你可以在此看到更多的信息:

问题回答

任何不显眼的变数通常最终都附属于全球窗口目标,因此,你可以试图绕过这个目标,看一看所附的变数(和特性),尽管有人警告说,已经有许多 st子。

任何范围很广的变量当然都属于其范围,这显然更难以以可靠的方式检索。 火力燃烧能够部分地发挥灵敏作用,因为它是一个延伸,能够在典型的浏览器安全边缘之外运作,从而更令人感兴趣和深厚的猜测。





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

热门标签