test for code [技术论坛 - HTML + JS]

正在浏览:   1 名游客


 到底部   前一个主题   下一个主题  [无发表权] 请登录或者注册



test for code
网站管理员
注册日期:
2004/6/25 19:16
所属群组:
网站管理员
注册会员
Dev+Hack
帖子: 3881
等级: 47; EXP: 22
HP : 1155 / 1155
MP : 1293 / 6453
离线

<p>Getting the most out of XMLHttpRequest generally involves using server-side generated XMLwhich can be retrieved by your JavaScript applicationparsed and used in more complex logicHowever, for a quick fix the following code will load an HTML fragment from a URL and insert it directly in to a page:</p>

<
p><pre class='code'>
function 
loadFragmentInToElement(fragment_urlelement_id) {
    var 
element document.getElementById(element_id);
    
element.innerHTML '<p><em>Loading ...</em></p>';
    
xmlhttp.open("GET"fragment_url);
    
xmlhttp.onreadystatechange = function() {
        if (
xmlhttp.readyState == &amp;&ampxmlhttp.status == 200) {
            
element.innerHTML xmlhttp.responseText;
        }
    }
    
xmlhttp.send(null);
}
</
pre></p>

2004/8/22 3:03
_________________
XOOPS
技术问题请在论坛提问 -- |自由|开源|共享|
应用扩展 工具箱


Re: test for code
网站管理员
注册日期:
2004/6/25 19:16
所属群组:
网站管理员
注册会员
Dev+Hack
帖子: 3881
等级: 47; EXP: 22
HP : 1155 / 1155
MP : 1293 / 6453
离线
引文:

D.J.写道:

<p>Getting the most out of XMLHttpRequest generally involves using server-side generated XMLwhich can be retrieved by your JavaScript applicationparsed and used in more complex logicHowever, for a quick fix the following code will load an HTML fragment from a URL and insert it directly in to a page:</p>

<
p><pre class='code'>
function 
loadFragmentInToElement(fragment_urlelement_id) {
    var 
element document.getElementById(element_id);
    
element.innerHTML '<p><em>Loading ...</em></p>';
    
xmlhttp.open("GET"fragment_url);
    
xmlhttp.onreadystatechange = function() {
        if (
xmlhttp.readyState == && xmlhttp.status == 200) {
            
element.innerHTML xmlhttp.responseText;
        }
    }
    
xmlhttp.send(null);
}
</
pre></p>

2004/8/22 3:04
_________________
XOOPS
技术问题请在论坛提问 -- |自由|开源|共享|
应用扩展 工具箱


Re: test for code
网站管理员
注册日期:
2004/6/25 19:16
所属群组:
网站管理员
注册会员
Dev+Hack
帖子: 3881
等级: 47; EXP: 22
HP : 1155 / 1155
MP : 1293 / 6453
离线
引文:

D.J.写道:
引文:

D.J.写道:

<p>Getting the most out of XMLHttpRequest generally involves using server-side generated XMLwhich can be retrieved by your JavaScript applicationparsed and used in more complex logicHowever, for a quick fix the following code will load an HTML fragment from a URL and insert it directly in to a page:</p>

<
p><pre class='code'>
function 
loadFragmentInToElement(fragment_urlelement_id) {
    var 
element document.getElementById(element_id);
    
element.innerHTML '<p><em>Loading ...</em></p>';
    
xmlhttp.open("GET"fragment_url);
    
xmlhttp.onreadystatechange = function() {
        if (
xmlhttp.readyState == && xmlhttp.status == 200) {
            
element.innerHTML xmlhttp.responseText;
        }
    }
    
xmlhttp.send(null);
}
</
pre></p>

2004/8/22 3:04
_________________
XOOPS
技术问题请在论坛提问 -- |自由|开源|共享|
应用扩展 工具箱



 回顶部   前一个主题   下一个主题

 [无发表权] 请登录或者注册


可以查看帖子.
不可发帖.
不可回复.
不可编辑自己的帖子.
不可删除自己的帖子.
不可发起投票调查.
不可在投票调查中投票.
不可上传附件.
不可不经审核直接发帖.

[高级搜索]