rejetto forum

loading file list

tdv · 4 · 5858

0 Members and 1 Guest are viewing this topic.

Offline tdv

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
I was so hoping that this method will work to get the files list, but alas.  :(

Template code:
Code: [Select]
[]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
</head>
<body>
 <div id="FilesContainer"></div>

<script type="text/javascript">
jQuery(document).ready(function()
 {
  $("#FilesContainer").load("%folder%?mode=section&id=FileList.html");
 });
</script>

</body>
</html>

[file=folder=link|private]
<br>%item-url%

[FileList.html]
%list%

May be worth processing a list of files in such (%folder%?mode=section&id=FileList.html) requests?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
try this

  $("#FilesContainer").load("{.get|url|tpl=list.}");


Offline tdv

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
Maybe {.get item|a|b.}? But unfortunately, it will not work.
jQuery.load send http request via ajax mechanism on the server, and all that I want is to process it according to all rules but from another section to eliminate all unnecessary html code. The result of this query is placed directly in the DIV tag. By the way, thus it is possible build and XML  response

I want to make walking on directories without reloading the page.
« Last Edit: November 24, 2013, 05:53:55 PM by tdv »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13523
    • View Profile
i tried what i suggested, and it works to me.
you can eventually change {.get|url|tpl=list.} with ?tpl=list
the first form is actually translated by the server itself, but the second should always work.
here is an example
$('body').load('?tpl=list')

in HFS 3 i already made a default template where you change folder without reloading the page.
They are not compatible, anyway, but you may eventually get inspiration.