- 浏览: 498883 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (301)
- Swing技术 (1)
- Linux (1)
- Javascript (22)
- 数据结构和算法 (3)
- J2SE (36)
- workflow (5)
- 设计模式 (14)
- web service (19)
- Ajax (14)
- 中间件 & 服务器 (8)
- 多线程 (9)
- Oracle (52)
- sys & soft (10)
- JMS (3)
- sso (9)
- android (11)
- struts2 (10)
- web协议 (2)
- 分布式 (2)
- PM (2)
- OLAP (3)
- Redis (2)
- Hibernate (7)
- ibatis (2)
- SQLServer (1)
- maven (3)
- Spring (7)
- Jsp (2)
- slf4j (1)
- jQuery (15)
- 权限 (1)
- 系统集成 (1)
- 笔记 (1)
- Freemarker (2)
- 项目管理 (1)
- eclipse (3)
- GIS (1)
- NoSql (3)
- win10 (1)
- win10网络 (2)
- 底层 (3)
- 数据库 (0)
最新评论
-
kabuto_v:
请问那种图,uml图是怎么画出来的呢?是您自己手工画的,还是有 ...
FastJSON 序列化、反序列化实现 -
梦行Monxin商城系统:
电商实例、业务并发、网站并发及解决方法 -
rockethj8:
client 㓟有一个参数是可以忽略一些URL 不进行验证登录 ...
SSO 之 (单点登录)实施中遇到的几个问题 -
mengxiangfeiyan:
好啊。。。。。
Oracle删除表,删除数据以及恢复数据、利用现有表创建新表
http://www.webshowme.com/04js/content.asp?id=933
1、函数一:
function ajaxLoader2(id,url) {
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x)
{
x.onreadystatechange = function()
{
if (x.readyState == 4 && x.status == 200)
{
el = document.getElementById(id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}
2、函数二、利用Iframe来完成
function ajaxLoader(id,url) {
str="<iframe width=\"100%\" height=\"440\" frameborder=\"0\" src=\""+url+"\"></iframe>";
document.getElementById(id).innerHTML=str;
}
3、函数三:与一差不多但是更具体
/***********************************************
* Ajax Page Fetcher- by JavaScript Kit (www.javascriptkit.com)
***********************************************/
var ajaxpagefetcher={
loadingmessage: "<center class=\"errmsg\">Loading Page, please wait...</center>",
exfilesadded: "",
connect:function(containerid, pageurl, bustcache, jsfiles, cssfiles){
var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE6 or below
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
var ajaxfriendlyurl=pageurl.replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
page_request.onreadystatechange=function(){ajaxpagefetcher.loadpage(page_request, containerid, pageurl, jsfiles, cssfiles)}
if (bustcache) //if bust caching of external page
bustcacheparameter=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
document.getElementById(containerid).innerHTML=decodeURIComponent(ajaxpagefetcher.loadingmessage) //Display "fetching page message"
page_request.open('GET', ajaxfriendlyurl+bustcacheparameter, true)
page_request.send(null)
},
loadpage:function(page_request, containerid, pageurl, jsfiles, cssfiles){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).innerHTML=page_request.responseText
for (var i=0; i<jsfiles.length; i++)
this.loadjscssfile(jsfiles[i], "js")
for (var i=0; i<cssfiles.length; i++)
this.loadjscssfile(cssfiles[i], "css")
this.pageloadaction(pageurl) //invoke custom "onpageload" event
}
},
createjscssfile:function(filename, filetype){
if (filetype=="js"){ //if filename is a external JavaScript file
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", filename)
}
else if (filetype=="css"){ //if filename is an external CSS file
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", filename)
}
return fileref
},
loadjscssfile:function(filename, filetype){ //load or replace (if already exists) external .js and .css files
if (this.exfilesadded.indexOf("["+filename+"]")==-1){ //if desired file to load hasnt already been loaded
var newelement=this.createjscssfile(filename, filetype)
document.getElementsByTagName("head")[0].appendChild(newelement)
this.exfilesadded+="["+filename+"]" //remember this file as being added
}
else{ //if file has been loaded already (replace/ refresh it)
var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist using
var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
var allsuspects=document.getElementsByTagName(targetelement)
for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1){
var newelement=this.createjscssfile(filename, filetype)
allsuspects[i].parentNode.replaceChild(newelement, allsuspects[i])
}
}
}
},
pageloadaction:function(pageurl){
this.onpageload(pageurl) //call customize onpageload() function when an ajax page is fetched/ loaded
},
onpageload:function(pageurl){
//do nothing by default
},
load:function(containerid, pageurl, bustcache, jsfiles, cssfiles){
var jsfiles=(typeof jsfiles=="undefined" || jsfiles=="")? [] : jsfiles
var cssfiles=(typeof cssfiles=="undefined" || cssfiles=="")? [] : cssfiles
this.connect(containerid, pageurl, bustcache, jsfiles, cssfiles)
}
} //End object
//Sample usage:
//jaxpagefetcher.load("container_id", "pageurl_or_path", bustcacheBool, [array_of_js_files], [array_of_css_files])
/*
The parameters in that order are:
container_id: The ID attribute of the DIV or some other container on the page that the Ajax page should load inside
pageurl_or_path: The URL or relative path from the current page to the external page to load. For the URL, it must be from the same domain as the current!
bustcacheBool:A Boolean value (true or false) specifying whether the script should prevent the browser from caching the page after it's been fetched for the 1st time. Set to true if the external page is dynamic and likely changes within the same browser session.
[array_of_js_files]:An optional array that contains the paths to a list of external .js files you wish to load at the same time, each separated by a comma if multiple. For example: ["functions.js", "message.js"].
[array_of_css_files]: An optional array that contains the paths to a list of external .css files you wish to load at the same time, each separated by a comma if multiple. For example: ["pagestyle.js"]
*/
//1) ajaxpagefetcher.load("mydiv", "content.htm", true)
//2) ajaxpagefetcher.load("mydiv2", "content.htm", true, ["external.js"])
//3) ajaxpagefetcher.load("mydiv2", "content.htm", true, ["external.js"], ["external.css"])
//4) ajaxpagefetcher.load("mydiv2", "content.htm", true, ["external.js", "external2.js"])
//5) ajaxpagefetcher.load("mydiv2", "content.htm", true, "", ["external.css", "external2.css"])
/*
<body>
<div id="joe"></div>
<script type="text/javascript">
// Fetch and display "content.htm" inside a DIV automatically as the page loads:
ajaxpagefetcher.load("joe", "content.htm", true)
</script>
<div id="bob"></div>
<script type="text/javascript">
<!-- Fetch and display "sub/content2.htm" inside a DIV when a link is clicked on. Also load one .css file-->
<a href="javascript:ajaxpagefetcher.load('bob', 'sub/content2.htm', false, '', ['page.css'])">Load Content 2</a>
</script>
</body>
*/
注意:使用权用函数一和三的时候,有可能会出现乱码,请将ID对象所在页面的编码改为utf-8编码
1、函数一:
function ajaxLoader2(id,url) {
if (document.getElementById) {
var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
}
if (x)
{
x.onreadystatechange = function()
{
if (x.readyState == 4 && x.status == 200)
{
el = document.getElementById(id);
el.innerHTML = x.responseText;
}
}
x.open("GET", url, true);
x.send(null);
}
}
2、函数二、利用Iframe来完成
function ajaxLoader(id,url) {
str="<iframe width=\"100%\" height=\"440\" frameborder=\"0\" src=\""+url+"\"></iframe>";
document.getElementById(id).innerHTML=str;
}
3、函数三:与一差不多但是更具体
/***********************************************
* Ajax Page Fetcher- by JavaScript Kit (www.javascriptkit.com)
***********************************************/
var ajaxpagefetcher={
loadingmessage: "<center class=\"errmsg\">Loading Page, please wait...</center>",
exfilesadded: "",
connect:function(containerid, pageurl, bustcache, jsfiles, cssfiles){
var page_request = false
var bustcacheparameter=""
if (window.XMLHttpRequest) // if Mozilla, IE7, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE6 or below
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
var ajaxfriendlyurl=pageurl.replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
page_request.onreadystatechange=function(){ajaxpagefetcher.loadpage(page_request, containerid, pageurl, jsfiles, cssfiles)}
if (bustcache) //if bust caching of external page
bustcacheparameter=(ajaxfriendlyurl.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
document.getElementById(containerid).innerHTML=decodeURIComponent(ajaxpagefetcher.loadingmessage) //Display "fetching page message"
page_request.open('GET', ajaxfriendlyurl+bustcacheparameter, true)
page_request.send(null)
},
loadpage:function(page_request, containerid, pageurl, jsfiles, cssfiles){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).innerHTML=page_request.responseText
for (var i=0; i<jsfiles.length; i++)
this.loadjscssfile(jsfiles[i], "js")
for (var i=0; i<cssfiles.length; i++)
this.loadjscssfile(cssfiles[i], "css")
this.pageloadaction(pageurl) //invoke custom "onpageload" event
}
},
createjscssfile:function(filename, filetype){
if (filetype=="js"){ //if filename is a external JavaScript file
var fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript")
fileref.setAttribute("src", filename)
}
else if (filetype=="css"){ //if filename is an external CSS file
var fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet")
fileref.setAttribute("type", "text/css")
fileref.setAttribute("href", filename)
}
return fileref
},
loadjscssfile:function(filename, filetype){ //load or replace (if already exists) external .js and .css files
if (this.exfilesadded.indexOf("["+filename+"]")==-1){ //if desired file to load hasnt already been loaded
var newelement=this.createjscssfile(filename, filetype)
document.getElementsByTagName("head")[0].appendChild(newelement)
this.exfilesadded+="["+filename+"]" //remember this file as being added
}
else{ //if file has been loaded already (replace/ refresh it)
var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none" //determine element type to create nodelist using
var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none" //determine corresponding attribute to test for
var allsuspects=document.getElementsByTagName(targetelement)
for (var i=allsuspects.length; i>=0; i--){ //search backwards within nodelist for matching elements to remove
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1){
var newelement=this.createjscssfile(filename, filetype)
allsuspects[i].parentNode.replaceChild(newelement, allsuspects[i])
}
}
}
},
pageloadaction:function(pageurl){
this.onpageload(pageurl) //call customize onpageload() function when an ajax page is fetched/ loaded
},
onpageload:function(pageurl){
//do nothing by default
},
load:function(containerid, pageurl, bustcache, jsfiles, cssfiles){
var jsfiles=(typeof jsfiles=="undefined" || jsfiles=="")? [] : jsfiles
var cssfiles=(typeof cssfiles=="undefined" || cssfiles=="")? [] : cssfiles
this.connect(containerid, pageurl, bustcache, jsfiles, cssfiles)
}
} //End object
//Sample usage:
//jaxpagefetcher.load("container_id", "pageurl_or_path", bustcacheBool, [array_of_js_files], [array_of_css_files])
/*
The parameters in that order are:
container_id: The ID attribute of the DIV or some other container on the page that the Ajax page should load inside
pageurl_or_path: The URL or relative path from the current page to the external page to load. For the URL, it must be from the same domain as the current!
bustcacheBool:A Boolean value (true or false) specifying whether the script should prevent the browser from caching the page after it's been fetched for the 1st time. Set to true if the external page is dynamic and likely changes within the same browser session.
[array_of_js_files]:An optional array that contains the paths to a list of external .js files you wish to load at the same time, each separated by a comma if multiple. For example: ["functions.js", "message.js"].
[array_of_css_files]: An optional array that contains the paths to a list of external .css files you wish to load at the same time, each separated by a comma if multiple. For example: ["pagestyle.js"]
*/
//1) ajaxpagefetcher.load("mydiv", "content.htm", true)
//2) ajaxpagefetcher.load("mydiv2", "content.htm", true, ["external.js"])
//3) ajaxpagefetcher.load("mydiv2", "content.htm", true, ["external.js"], ["external.css"])
//4) ajaxpagefetcher.load("mydiv2", "content.htm", true, ["external.js", "external2.js"])
//5) ajaxpagefetcher.load("mydiv2", "content.htm", true, "", ["external.css", "external2.css"])
/*
<body>
<div id="joe"></div>
<script type="text/javascript">
// Fetch and display "content.htm" inside a DIV automatically as the page loads:
ajaxpagefetcher.load("joe", "content.htm", true)
</script>
<div id="bob"></div>
<script type="text/javascript">
<!-- Fetch and display "sub/content2.htm" inside a DIV when a link is clicked on. Also load one .css file-->
<a href="javascript:ajaxpagefetcher.load('bob', 'sub/content2.htm', false, '', ['page.css'])">Load Content 2</a>
</script>
</body>
*/
注意:使用权用函数一和三的时候,有可能会出现乱码,请将ID对象所在页面的编码改为utf-8编码
发表评论
-
对Mvvm模式的理解及框架介绍
2016-01-15 10:21 1647使用WPF+Mvvm ... -
JQuery上传插件Uploadify使用详解
2012-11-07 22:30 1024http://blog.csdn.net/longao ... -
jQuery常用方法
2012-11-07 22:26 883http://blog.csdn.net/longao ... -
jQuery省市县联动插件演示
2012-11-07 22:22 1512http://blog.csdn.net/longa ... -
Ajax跨子域之document.domain+iframe实现
2012-10-22 00:40 1640http://js8.in/443.html Ajax ... -
prototype.js 的 Ajax.updater 的 用法
2012-10-11 11:36 1221http://www.cnblogs.com/bey ... -
Ajax缓存解决办法
2012-09-25 20:40 929AJAX缓存的问题:解决办 ... -
服务器端可控情形的Javascript跨域访问解决方法
2012-09-17 00:45 942http://weidagang2046.blo ... -
Div里面载入另一个页面的实现(取代框架)(AJax)
2012-09-13 23:50 3958http://blog.csdn.net/franzh ... -
AJAX传值(精)
2012-09-13 22:57 1189http://www.360doc.com/conte ... -
掌握 Ajax 系列
2012-09-05 23:06 752http://www.ibm.com/develope ... -
Ajax 中跨域问题的结决办法
2012-08-23 12:36 915[转] ajax伴随的goole 的推动,越来越多的站点开始使 ... -
Ajax 中跨域问题的结决办法
2012-08-23 00:45 917ajax伴随的goole 的推动,越来越多的站点开始使用了,在 ...
相关推荐
修炼成Javascript中级程序员必知必会_资源分享
内容概要:本文详细介绍了如何使用MATLAB的深度学习工具箱,在果树病虫害识别任务中从数据准备、模型设计、训练优化到最后的模型评估与应用全流程的具体实施步骤和技术要点。涵盖了MATLAB深度学习工具箱的基本概念及其提供的多种功能组件,如卷积神经网络(CNN)的应用实例。此外,文中还具体讲述了数据集的收集与预处理方法、不同类型的深度学习模型搭建、训练过程中的超参数设定及其优化手段,并提供了病虫害识别的实际案例。最后展望了深度学习技术在未来农业领域的潜在影响力和发展前景。 适合人群:对深度学习及农业应用感兴趣的科研人员、高校师生和相关从业者。 使用场景及目标:①希望掌握MATLAB环境下构建深度学习模型的方法和技术细节;②从事果树病虫害管理研究或实践,寻找高效的自动化解决方案。 阅读建议:在阅读本文之前,建议读者熟悉基本的MATLAB编程环境及初步了解机器学习的相关概念。针对文中涉及的理论和技术难点,可以通过官方文档或其他教程进行补充学习。同时,建议动手实践每一个关键点的内容,在实践中加深理解和掌握技能。
nodejs010-nodejs-block-stream-0.0.7-1.el6.centos.alt.noarch.rpm
机械模型与技术交底书的融合:创新点详解与解析,机械模型加技术交底书,有创新点 ,机械模型; 技术交底书; 创新点,创新机械模型与技术交底书详解
免费JAVA毕业设计 2024成品源码+论文+数据库+启动教程 启动教程:https://www.bilibili.com/video/BV1SzbFe7EGZ 项目讲解视频:https://www.bilibili.com/video/BV1Tb421n72S 二次开发教程:https://www.bilibili.com/video/BV18i421i7Dx
免费JAVA毕业设计 2024成品源码+论文+数据库+启动教程 启动教程:https://www.bilibili.com/video/BV1SzbFe7EGZ 项目讲解视频:https://www.bilibili.com/video/BV1Tb421n72S 二次开发教程:https://www.bilibili.com/video/BV18i421i7Dx
nodejs010-nodejs-cmd-shim-1.1.0-4.1.el6.centos.alt.noarch.rpm
西门子四轴卧加后处理系统:828D至840D兼容,四轴联动高效加工解决方案,支持图档处理及试看程序。,西门子四轴卧加后处理,支持828D~840D系统,支持四轴联动,可制制,看清楚联系,可提供图档处理试看程序 ,核心关键词:西门子四轴卧加后处理; 828D~840D系统支持; 四轴联动; 制程; 联系; 图档处理试看程序。,西门子四轴卧加后处理程序,支持多种系统与四轴联动
基于黏菌优化算法(SMA)的改进与复现——融合EO算法更新策略的ESMA项目报告,黏菌优化算法(SMA)复现(融合EO算法改进更新策略)——ESMA。 复现内容包括:改进算法实现、23个基准测试函数、多次实验运行并计算均值标准差等统计量、与SMA对比等。 程序基本上每一步都有注释,非常易懂,代码质量极高,便于新手学习和理解。 ,SMA复现;EO算法改进;算法实现;基准测试函数;实验运行;统计量;SMA对比;程序注释;代码质量;学习理解。,标题:ESMA算法复现:黏菌优化与EO算法融合改进的实证研究
基于MATLAB的Stewart平台并联机器人仿真技术研究与实现:Simscape环境下的虚拟模拟分析与应用,MATLAB并联机器人Stewart平台仿真simscape ,MATLAB; 并联机器人; Stewart平台; 仿真; Simscape; 关键技术。,MATLAB中Stewart平台并联机器人Simscape仿真
Grad-CAM可视化医学3D影像
探索comsol泰勒锥:电流体动力学的微观世界之旅,comsol泰勒锥、电流体动力学 ,comsol泰勒锥; 电流体动力学; 锥形结构; 电场影响,COMSOL泰勒锥与电流体动力学研究
免费JAVA毕业设计 2024成品源码+论文+数据库+启动教程 启动教程:https://www.bilibili.com/video/BV1SzbFe7EGZ 项目讲解视频:https://www.bilibili.com/video/BV1Tb421n72S 二次开发教程:https://www.bilibili.com/video/BV18i421i7Dx
PFC6.03D模型动态压缩模拟与SHPB霍普金森压杆系统理论及实验数据处理技术解析,PFC6.03D模型,动态压缩模拟,还包括: SHPB霍普金森压杆系统理论知识介绍,二波法和三波法处理实验数据,提出三波波形,计算动态压缩强度等 ,PFC模型; 动态压缩模拟; SHPB霍普金森压杆系统; 理论介绍; 二波法处理; 三波法处理; 三波波形; 动态压缩强度。,"PFC模型下的动态压缩模拟及SHPB理论实践研究"
ProASCI 开发板原理图,适用于A3P3000
免费JAVA毕业设计 2024成品源码+论文+录屏+启动教程 启动教程:https://www.bilibili.com/video/BV1SzbFe7EGZ 项目讲解视频:https://www.bilibili.com/video/BV1Tb421n72S 二次开发教程:https://www.bilibili.com/video/BV18i421i7Dx
1、文件内容:pykde4-devel-4.10.5-6.el7.rpm以及相关依赖 2、文件形式:tar.gz压缩包 3、安装指令: #Step1、解压 tar -zxvf /mnt/data/output/pykde4-devel-4.10.5-6.el7.tar.gz #Step2、进入解压后的目录,执行安装 sudo rpm -ivh *.rpm 4、安装指导:私信博主,全程指导安装
基于Comsol模拟的三层顶板随机裂隙浆液扩散模型:考虑重力影响的瞬态扩散规律分析,Comsol模拟,考虑三层顶板包含随机裂隙的浆液扩散模型,考虑浆液重力的影响,模型采用的DFN插件建立随机裂隙,采用达西定律模块中的储水模型为控制方程,分析不同注浆压力条件下的浆液扩散规律,建立瞬态模型 ,Comsol模拟; 随机裂隙浆液扩散模型; 浆液重力影响; DFN插件; 达西定律模块储水模型; 注浆压力条件; 浆液扩散规律; 瞬态模型,Comsol浆液扩散模型:随机裂隙下考虑重力的瞬态扩散分析
A simple fast, easy use distributed file system written by golang(similar fastdfs).go-fastdfs
手机编程-1738391552157.jpg