📄 index.html
字号:
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>
ajaxed Library 0.2 Documentation
</title>
<style>
body {
padding:0; margin:0;
overflow:hidden;
}
* {
font-size:12px;
font-family:arial;
}
#menu {
overflow:auto;
height:400px;
padding:20px;
}
.menuItem {
margin-bottom:5px;
font-weight:bold;
}
.label {
font-weight:bold;
}
.cDescription {
font-size:16px;
margin:10px 0px;
}
h1 {
background-color:#8DB2FF;
padding:5px;
margin:15px 0px;
}
h2 {
background-color:#eee;
font-size:14px;
font-weight:bold;
padding:4px;
margin-bottom:0;
}
.method {
margin:5px 0px;
}
.table {
width:100%;
border-collapse:collapse;
}
.table td, .table th {
border:1px solid #eee;
text-align:left;
}
legend {
font-size:20px;
font-weight:bold;
}
fieldset {
padding:10px;
margin:10px 0;
}
.type, .type * {
font-family:courier;
}
.cDescription {
text-align:justify;
}
.mdetails {
margin:10px;
padding:10px;
border:2px inset #bbb;
background-color:#F7F7F7;
}
.button {
width:70px;
padding:2px;
font-family:tahoma;
}
a:hover, a:link, a:visited, a:active {
color:#0000FF;
}
.obsolete, .obsolete *, .obsolete a:link, .obsolete a:visited, .obsolete a:active, .obsolete a {
white-space: nowrap;
font-weight: normal;
color:#E10000;
}
/* this is just for Firefox */
html>body #content {
overflow:auto;
overflow-x: hidden;
}
.class {
width:680px;
text-align:left;
}
</style>
<style media="print">
body {
overflow:auto;
}
.notForPrint {
display:none;
}
.alwaysPrint {
display:block;
}
.class {
width:auto;
page-break-before:always;
}
fieldset {
border:0px;
}
#content {
overflow:visible;
height:auto;
}
</style><script>
function toggle(eID) {
el = document.getElementById(eID);
if (el) el.style.display = (el.style.display == 'none') ? 'block' : 'none';
}
</script></head>
<body>
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td class="notForPrint" valign="top" width="250" style="background-color:#eee;">
<fieldset style="margin:20px;background-color:#fff;">
<div id="menu">
<div class="menuItem"><a href="#class_1">AjaxedPage</a></div>
<div class="menuItem"><a href="#class_2">Database</a></div>
<div class="menuItem"><a href="#class_3">JSON</a></div>
<div class="menuItem"><a href="#class_4">Library</a></div>
<div class="menuItem"><a href="#class_5">StringOperations</a></div>
</div>
<div style="margin-top:20px;"><button class="button" accesskey="p" onclick="window.print()"><u>P</u>rint</button><button class="button" accesskey="c" onclick="window.close()"><u>C</u>lose</button><div style="font-size:10px;margin-top:8px;">
documented with<br>
GabLibrary Documentor.<br>
(7/16/2007 10:09:47 PM)
</div>
</div>
</fieldset>
</td><td style="padding-left:20px;">
<div id="content"><a name="top"></a><br><br><a name="class_1"></a><fieldset class="class">
<legend>
Class AjaxedPage <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a page which Provides the functionality to call server-side ASP procedures
directly from client-side. When using the class be sure the draw() method is the first
which is called before any response has been done.
init(), main() and callback() need to be implemented within the page. init() is always
called first and allows preperation before any content is written to the response e.g.
security checks and stuff which is necessary for main() and callback() should be placed
into the init(). After the init whether main() or callback() is called. They are never
called both within one page execution.
main() = common state for the page which shows the user's presentation
callback() = handles all client requests
callback() needs to be defined with an parameter which holds the actual action to perform.
so the signature should be sub callback(action)
- REFER TO demo.asp FOR A SAMPLE USAGE.
- Requires Prototype JavaScript library (available at prototypejs.org)</div>
<table cellspacing="0" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru at grafix.at on 2007-06-28 20:32</td>
</tr>
<tr>
<td class="label">Last modified:</td>
<td>16.07.2007 21:51:24</td>
</tr>
<tr>
<td class="label">Path:</td>
<td>/ajaxed/class_ajaxedPage/ajaxedPage.asp</td>
</tr>
</table>
<h2><span onclick="toggle('props_1')" style="cursor:pointer">Properties</span> <a href="#class_1" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_1" style="display:none" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top">
<td class="property">buffering</td>
<td class="type"><span class="type">bool</span> </td>
<td>turns the response.buffering on or off (no affect on callback). default = true </td>
</tr>
<tr valign="top">
<td class="property">contentType</td>
<td class="type"><span class="type">string</span> </td>
<td>contenttype of the response. default = empty </td>
</tr>
<tr valign="top">
<td class="property">DBConnection</td>
<td class="type"><span class="type">bool</span> </td>
<td>indicates if a database connection should be opened automatically for the page.
If yes then a connection with the configured connectionstring is established and can be used
within the init(), callback() and main() procedures. default = false </td>
</tr>
<tr valign="top">
<td class="property">debug</td>
<td class="type"><span class="type">bool</span> </td>
<td>turns debugging on of. default = false </td>
</tr>
<tr valign="top">
<td class="property">loadPrototypeJS</td>
<td class="type"><span class="type">bool</span> </td>
<td>should protypeJS library be loaded. turn this off if you've done it manually. default = true </td>
</tr>
</table>
<h2><span onclick="toggle('meths_1')" style="cursor:pointer">Methods</span> <a href="#class_1" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_1" class="table alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAFQI0" onclick="toggle('mdetails_1IDAFQI0')">[error]
(
msg
)
</a></div>
<div class="obsolete">(This method is obsolete)</div>
<div class="mDesc">OBSOLETE! use lib.error() instead.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAFQI0"><br><div><strong> msg</strong>
: </div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAWKI0" onclick="toggle('mdetails_1IDAWKI0')">draw
(
)
</a></div>
<div class="mDesc">Draws the page. Must be the first call on a page</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAWKI0">The lifecycle is the following after executing draw().
1. setting the HTTP Headers (response)
2. init()
3. main() or callback(action) - action is trimmed to 255 chars (for security reasons)
- dont forget to provide your HTML, HEAD and BODY tags. The page does not do this for you ;)<br></div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAIPI0" onclick="toggle('mdetails_1IDAIPI0')">execJS
(
JSCode
)
</a></div>
<div class="mDesc">executes a given javascript. input may be a string or an array. each field = a line</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAIPI0"><br><div><strong> JSCode</strong><span class="type">
(
<span class="type">string. array</span>
)
</span>
: your javascript-code. e.g. window.location.reload()</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAMYI0" onclick="toggle('mdetails_1IDAMYI0')">getLocation
(
format withQS
)
</a></div>
<div class="mDesc">gets the location of the page you are in. virtual, physical, file or the full URL of the page</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAMYI0"><br><div><strong>byVal format</strong>
: </div>
<div><strong> withQS</strong><span class="type">
(
<span class="type">bool</span>
)
</span>
: should the querystring be appended or not?</div>
<div><strong>Return </strong>
(
<span class="type">string</span>
) :
the location of the executing page in the wanted format</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA5WI0" onclick="toggle('mdetails_1IDA5WI0')">iif
(
i j k
)
</a></div>
<div class="obsolete">(This method is obsolete)</div>
<div class="mDesc"></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDA5WI0">OBSOLETE! use lib.iif instead<br><br><div><strong> i</strong>
: </div>
<div><strong> j</strong>
: </div>
<div><strong> k</strong>
: </div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAENI0" onclick="toggle('mdetails_1IDAENI0')">isPostback
(
)
</a></div>
<div class="mDesc">Returns wheather the page was already sent to server or not.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAENI0">It should be the same as the isPostback() from asp.net.<br><div><strong>Return </strong>
(
<span class="type">bool</span>
) :
posted back (true) or not (false)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA1VI0" onclick="toggle('mdetails_1IDA1VI0')">loadCSSFile
(
url media
)
</a></div>
<div class="mDesc">Loads a specified stylesheet-file</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDA1VI0">does not work on callback()<br><br><div><strong> url</strong><span class="type">
(
<span class="type">string</span>
)
</span>
: url of your stylesheet</div>
<div><strong> media</strong><span class="type">
(
<span class="type">string</span>
)
</span>
: what media is this stylesheet for. screen, etc.
leave it blank if its for every media</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDABVI0" onclick="toggle('mdetails_1IDABVI0')">loadJSFile
(
url
)
</a></div>
<div class="mDesc">Loads a specified javscript-file</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDABVI0">it will load the file only if it has not been already loaded on the page before.
so you can load the file and dont have to worry if it will be loaded more than once.
differentiation between the files is the filename (case-sensitive!).
does not work on callback()<br><br><div><strong> url</strong><span class="type">
(
<span class="type">string</span>
)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -