<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- used from test_RemotePane.html -->
<html>
<head>
<title>ContentPane External pathsfixes Test</title>
<link rel="stylesheet" href="test_RemotePaths.css" />
<script type="text/javascript">
djConfig = {
isDebug: true
};
</script>
<script type="text/javascript" src="../../../dojo.js"></script>
<script type="text/javascript">
dojo.require("dojo.event.*");
//--------------------------------test setting private vars to execScope ----------------------------
//set up event listeners
var connected = false;
function connect(){
var dec = connected ? dojo.event.disconnect : dojo.event.connect;
dojo.debug((connected ? "disconnect" : "connect")+" eventlisteners");
connected = true;
// connect to links using the new array syntax
dec(["https", "http", "ftps", "ftp", "news", "file", "mailto","javascript", "relative"],
"onclick",
obj,
"isPathFixed");
// connect to toggle clicks
dec(dojo.byId("inFileToggler"), "onclick", obj, "inFileScriptToggle");
dec(dojo.byId("extToggler"), "onclick", obj, "extScriptToggle");
}
var obj = {
// toggle
inFileScriptToggle: function(){
var a = document.getElementById("inFileToggler");
var txt = a.firstChild.nodeValue;
if(txt == "In file scripttest, Released"){
txt = "In file scripttest, Pushed";
}else{
txt = "In file scripttest, Released";
}
a.firstChild.nodeValue = txt;
},
//checks if paths are set up correctly
isPathFixed: function (evt){
var node = evt.currentTarget;
dojo.event.browser.stopEvent(evt);
var fail = false;
var href = node.href.replace(/\/$/, ""); // strip after slash that browsers seem to append
var shouldBe = node.firstChild.nodeValue; // linktext is our guide of what paths should be
if(node.id=="file" || node.id=="javascript"){
href = href.toLowerCase().replace(/%20/g, ' '); // FF and Opera replaces Document to document
href = href.substr(0,7) + href.substr(7 ,href.length).replace(/\//g, '\\'); // IE replaces to / in wine
shouldBe = shouldBe.toLowerCase();
}else if(node.id=="relative"){
// translate path to be relative to this folder
shouldBe = new dojo.uri.Uri(location, shouldBe.substr(3)).toString();
}
// do the check
if(href == shouldBe){
alert("Test passed for "+node.id+"!");
}else{
alert("Failure in "+node.id+"\n"+href+"\n should be \n"+shouldBe);
}
}
};
//-------------------------- test setting objects to global scope -------------------------------------------
// this function gets set onto window object, notice the absence of var!
globalVar = "Hello from a global string!";
globalFunction = function(){ // same as window.globalFunction
alert(globalVar);
}
// NOTE: this function gets cleared by the garbage collect when we fill with new content
// But only in KHTML, Presto, and possibly Webcore.
isGlobalSticky = function(back){
var pane = dojo.widget.byId("docpane");
if(pane){
if(back){
pane.setUrl("acme/test_RemotePaths.html");
}else{
var content = "<h3>The content in this page comes from a global function set by test_RemotePaths.html</h3>"
+" If everything works you should be able to get back by clicking"
+" <a href='javascript:isGlobalSticky(true)'>here</a>";
pane.setContent(content);
}
}
}
//----------------------------- set up onload and onUnLoad listeners --------------------------------------
if(typeof _container_ == 'undefined'){ // browsing page as standalone
dojo.addOnLoad(obj.connect);
}else{
_container_.addOnLoad(connect);
_container_.addOnUnload(connect);
}
</script>
<script type="text/javascript" src="RemotePaths_test.js"></script>
</head>
<body>
<style type="text/css">
/*!!!note not in head on purpose, should get ripped out of content before _setContent and inserted to document head*/
#bgstyleimagetest{
background-image: url(../images/tools.gif);
}
.border{
border: 1px solid black;
}
.linkSimulants{
cursor: pointer;
text-decoration:underline;
color: blue;
}
</style>
<a name="top"><a href="#bottom">Test anchor tags</a></a>
<h3>Image and css paths</h3>
<img class="border" src="../images/tools.gif"/><-image path test, should be a tool image<br/>
<span class="border" id="bgimagetest"> </span><-remote css file test, background should be toolimage (may be cut)<br/>
<span class="border" style="background-image: url(../images/tools.gif);"> </span><-inline css test, background should be toolimage (may be cut)<br/>
<span class="border" id="bgstyleimagetest"> </span><-stylenode css test, background should be toolimage (may be cut)<br/><br/>
<h3/>External link paths, should'nt be clobbered by pathsfix mechanism</h3>
<a href="https://some.secure.site" id="https">https://some.secure.site</a><br/>
<a href="http://some.ordinary.site" id="http">http://some.ordinary.site</a><br/>
<a href="ftps://some.secure.ftp" id="ftps">ftps://some.secure.ftp</a><br/>
<a href="ftp://some.ordinary.ftp" id="ftp">ftp://some.ordinary.ftp</a><br/>
<a href="file://C:\Document and settings\All users\local.html" id="file">file://C:\Document and settings\All users\local.html</a><br/>
<a href="news:dojotoolkit.org" id="news">news:dojotoolkit.org</a><br/>
<a href="mailto:nospam@dojotoolkit.org" id="mailto" correctPath="mailto:nospam@dojotoolkit.org">mailto:nospam@dojotoolkit.org</a><br/>
<a href="javascript:myFunc(1, 2, 3);" id="javascript">javascript:myFunc(1, 2, 3);</a><br/><br/>
<h3>Fixed linkpaths, should get repointed relative to this path.</h3>
why anyone would ever want to do ordinary links in a ajax app is beyond me, but here it goes.<br/>
<a href="../test_Button.html?key=value&value=key" id="relative">../test_Button.html?key=value&value=key</a><br/>
<h3>Inline eventhandlers</h3>
<a href="javascript:globalFunction();">Click for a global string</a><br/>
<a href="javascript:isGlobalSticky();">Click to test if global remains in memory after new content.</a> WARNING! It is allways better to include global code in the root page
<h3><a name="bottom">Scrips, needs executescripts=true</a></h3>
<span class="linkSimulants" id="inFileToggler">In file scripttest, Released</span><br/>
<span class="linkSimulants" id="extToggler">Ext. js file scripttest, Released</span><br/><br/>
<a href="#top">To top!</a>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
征服ajax实例源代码
共330个文件
html:104个
js:49个
gif:49个
需积分: 9 22 下载量 164 浏览量
2008-01-17
16:04:00
上传
评论
收藏 1.67MB RAR 举报
温馨提示
征服ajax Dojo、Prototype、script.aculo.us框架解析与实例源代码
资源推荐
资源详情
资源评论
收起资源包目录
征服ajax实例源代码 (330个子文件)
Default.aspx 11KB
Main.aspx 3KB
NewMessage.aspx 3KB
Main3.aspx 3KB
Main2.aspx 2KB
Default.aspx 2KB
Default.aspx 1KB
SendMessage.aspx 133B
ListMail.aspx 118B
CheckNewMessage.aspx 117B
DeleteMessage.aspx 113B
MailContent.aspx 109B
DeleteSection.aspx 106B
RenameSection.aspx 106B
ListSection.aspx 102B
MoveSection.aspx 102B
AddSection.aspx 100B
DeleteNote.aspx 100B
Login.aspx 99B
ListNotes.aspx 98B
RssRender.aspx 98B
EditNote.aspx 96B
MoveNote.aspx 96B
AddNote.aspx 94B
ClassDiagram.cd 4KB
Web.config 2KB
Web.Config 2KB
Web.Config 2KB
web.config 1KB
Pop3MailClient.cs 30KB
Pop3MimeClient.cs 29KB
RxMailMessage.cs 11KB
QuotedPrintable.cs 7KB
LocalMailService.cs 3KB
LocalDbService.cs 3KB
AddNote.aspx.cs 2KB
ListNotes.aspx.cs 2KB
ListMail.aspx.cs 2KB
EditNote.aspx.cs 2KB
DbService.cs 2KB
SendMessage.aspx.cs 2KB
ListSection.aspx.cs 1KB
RenameSection.aspx.cs 1KB
MoveNote.aspx.cs 1KB
MoveSection.aspx.cs 1KB
AddSection.aspx.cs 1KB
CheckNewMessage.aspx.cs 1KB
ServerSetting.cs 1KB
Login.aspx.cs 1KB
DeleteSection.aspx.cs 1KB
DeleteNote.aspx.cs 1KB
RssRender.aspx.cs 1022B
MailService.cs 967B
MailContent.aspx.cs 929B
DeleteMessage.aspx.cs 797B
NewMessage.aspx.cs 408B
Default.aspx.cs 406B
Main2.aspx.cs 403B
Main3.aspx.cs 403B
Main.aspx.cs 402B
Default.aspx.cs 380B
Default.aspx.cs 380B
notebook.css 5KB
mail.css 3KB
style.css 3KB
default.css 2KB
style.css 1KB
global.css 682B
test.css 617B
global.css 429B
Memo.css 382B
test_RemotePaths.css 177B
debugger.css 84B
Thumbs.db 13KB
Microsoft.Practices.EnterpriseLibrary.Common.dll 92KB
Microsoft.Practices.EnterpriseLibrary.Common.dll 92KB
Microsoft.Practices.EnterpriseLibrary.Data.dll 68KB
Microsoft.Practices.EnterpriseLibrary.Data.dll 68KB
Microsoft.Practices.ObjectBuilder.dll 60KB
Microsoft.Practices.ObjectBuilder.dll 60KB
光盘使用必读.doc 679KB
book.gif 4KB
active-r.gif 1KB
active-c.gif 1KB
inactive-c.gif 1KB
active-l.gif 1KB
inactive-r.gif 1KB
pressed-r.gif 1KB
pressed-l.gif 1KB
disabled-r.gif 1KB
inactive-l.gif 1KB
disabled-l.gif 1KB
disabled-c.gif 1KB
pressed-c.gif 1KB
ok.gif 1KB
h3_quickSummary.gif 1KB
h3_lresources.gif 999B
ft-headup.gif 930B
ft-headdown.gif 930B
loading.gif 878B
共 330 条
- 1
- 2
- 3
- 4
资源评论
junqi1984
- 粉丝: 0
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- video_20240425_124410_edit.mp4
- IMG_20240425_120538.jpg
- My Complete Genome_6k Base-Pairs of Phenotype SNPs_Complete Raw Data.zip
- qt 的mqtt测试demo
- 移动应用开发教程-zip.zip
- mosquitto-2.018-install-windows-x64
- FTPServer FTP 服务器,绿色免安装,单文件
- 梦畅语音点名软件,上课点名
- 利用ADNI数据集和标签,在tensorflow框架上使用tensorlayer接口,通过架构u-net实现海马体的分割
- Kutools for Word v9.0 office word 插件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功