
Discussion of the
previous article was stormy. The most ardent lovers of jQuery, Mootools screaming why they say you need another bike.
In this article we will consider the use of technology Fly AJAX. This is one of several features that are not implemented in the previously mentioned large (and respected) frameworks. Also, in this article, we will consider the principles of proper design and construction of sites for good indexing using AJAX technology.
"Awesome" AJAX
The Fly AJAX technology is an on-the-fly conversion of common links to AJAX links. Using this technology, we can easily convert the usual loading of content from links to web pages into asynchronous loading.
Consider an example. Suppose we have a site menu
<ul>
<li><a href="/content/info">Info</a></li>
<li><a href="/content/download">Download</a></li>
<li><a href="/content/contact">Contact</a></li>
</ul>
<div id="content-body">Welcome</div>
, , .
Fly AJAX. AJAX , SRAX.Filter.
SRAX.Filter — «-», «-» AJAX . .
SRAX.Filter.add({url:'/content/', id:'content-body'})
! .
id — , .
url — , , .
SRAX.Filter
- id — id
- url —
- urlType — 'contain' ( ) 'start' 'end' — ,
- query —
- queryType — 'contain' ( ) 'start' 'end' — ,
- join (joinLogic) — url query — 'or' ( ) 'and'
- changer (urlChanger) — urlChanger: function(url, owner){return url.replace('index.php', 'mypage.php')}
- target — true target (_self, _parent, _top, _blank) false — ( )
- type — = 'skip', «AJAX »; = 'data', dax, hax
- handler — , , type
- + hax ( , hax)
: /content/download?id=1 — url=/content/download query=id=1.
SRAX.Filter.add({query:'id=', id:'main-content'})
, url query, join.
.
handler changer.
ax: <a>,<form>,<area>
Fly AJAX ax <a>. , Fullajax .
<ul>
<li><a ax:id="content-body" href="/content/info">Info</a></li>
<li><a ax:id="content-body" href="/content/download">Download</a></li>
<li><a ax:id="content-body" href="/content/contact">Contact</a></li>
</ul>
<div id="content-body">Welcome</div>
! , .
, , javascript . SRAX.Filter, ax: ( ).
Fly AJAX , .. onclick
<a ax:id='content' href="/mypage" onclick="alert(1)">
alert, . onclick false — AJAX .
- <form> <area>.
AJAX . .. , . AJAX X-Requested-With=XMLHttpRequest. . — . , model2 («--» — ),
. .
AJAX
AJAX . , — . , . AJAX !!! ! …

, Fly AJAX AJAX .
« », .
- SRAX.directLink — AJAX
- SRAX.linkEqual — AJAX -
!!!

.