📜 ⬆️ ⬇️

Fly AJAX - write less, keep more. Non-standard AJAX and indexing by search engines.


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


: /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 .
« », .



!!! .

')

Source: https://habr.com/ru/post/54465/


All Articles