如何删除jquery json弹出窗口? [英] How to remove jquery json popup?
问题描述
我将在html页面中添加jquery json数据的位置. 所有HTML页面组件均消失,仅在页面左上方显示json数据:
Where I am going to add jquery json data in html page. All HTML page components disappear and only show json data in left top of the page:
$.getJSON('http://api.wipmania.com/jsonp?callback=?',
function (data) {
document.write('Latitude: ' + data.latitude + '\nLongitude: ' + data.longitude + '\nCountry: ' + data.address.country);
}
);
推荐答案
Reading the documentation for document.write()
we find this:
将文本字符串写入由打开的文档流
document.open()
. [...]
正在写入已加载的文档 无需调用document.open()
即可自动执行document.open
通话
Writes a string of text to a document stream opened by
document.open()
. [...]
Writing to a document that has already loaded without callingdocument.open()
will automatically perform adocument.open
call
...和document.open()
的文档说:
document.open()方法打开一个文档进行写入. [...]
如果 文档存在于目标中,此方法将其清除
The document.open() method opens a document for writing. [...]
If a document exists in the target, this method clears it
使用document.write()
注入原始HTML可能是创建动态文档的最烦人的工具.您正在使用jQuery-利用其DOM操作工具.
Using document.write()
to inject raw HTML is possibly the most annoying tool to create dynamic documents. You are using jQuery—make use of its DOM manipulation tools.
这篇关于如何删除jquery json弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!