Some sites wish to load everything or almost everything via AJAX. Accomplishing this presents numerious challenges.

I've roughed in a first round of changes toward this goal.

1. A settings page to select what to load. Form built, options not fully implemented.

2. Return additional data with page.

- title: used to set the page title
- help, status messages, tabs, title element
- scripts and css (not yet used)

3. Introduce history support. This is partly working but buggy. Uses hashes, e.g., http://example.com/#node/23

To get this to work I've patched the jquery.history_remote library.

4. On initial page load, switch to base url with hash. If there is a hash, load it.

Still to come:

1. Read in the Drupal.settings object as passed from the page being loaded.

2. Dynamically load scripts and css files as needed.

3. Lots of bugfixing.

4. Overwrite collapse.js attach behavior to make reattachable.

Comments

nedjo’s picture

Items 1, 2, and 4 of the "still to come" list are now done.

Testing and bugfixing ongoing. Testers of dynamicload HEAD would be very welcome.

felixsmile’s picture

Hi again, hi Nedjo!

First of all, thank a lot for all the work you're doing! It's really incredible. I've downloaded the HEAD version, and it breaks my dynamicload functionality. In firefox (with firebug), I get the following message:

Drupal.behaviors has no properties
[Break on this error] Drupal.behaviors.dynamicload = function (context) {

Using Drupal 5.1, same as usual, with garland. In the new configuration window, I don't really understand your explanation for this:

Load region data:
left sidebar
right sidebar
content
header
footer
If you wish to refresh block regions with page loads, select the regions here. Only selected regions will be loaded.

I've enabled this feature, and disabled it again, that doesn't change anything. Of course, I've enabled the dynamic loading in the blocks menu.

I am willing and happy to test your great work, and am looking forward to the next version. Have a nice day,

Felix.

nedjo’s picture

Please ensure you have the HEAD version of jstools.js. That's where When you update any Javascript Tools module, you should update all to the same version, as many are interdependent.

The option you asked about will refresh a region's content when the main content area is refreshed. You won't necessarily see any difference after the refresh. Differences will be evident however if e.g. the region contains specific blocks on the path being loaded into the main content area.

felixsmile’s picture

Hi Nedjo,

as I'm not really sure where to post all these little things, I'll post it here, so you'll know about the issues.

The problem before was, indeed, a version problem, I still had the old version of jstools.js in my firefox cache... Sorry about that.

Now, the thing with the titles isn't solved in this version for me, I'll post this in the appropriate thread.

The module is now working again, but you added a functionality which is not always compatible with the ActiveMenu module. When I tell it to refresh the Navigation block every 30 seconds (I wanted to see what it does), it refreshes the block, but the ActiveMenu functionality gets lost.

Another little issue, but I think you can't do anything about this, is that the address bar doesn't really get updated, so that if you refresh the page (browser refresh), you go back to the page you have in the address bar, whatever is after the #.

I like the new little animation when using ActiveMenu. It may be just subjective, but I get the impression it was quicker when there was none.

If I enable the feature "process all links" in dynamicload, I can't browse taxonomy terms anymore, he wants to load something like http://127.0.0.1:12345/#taxonomy/term/7 and he can't establish a connection to the server, he says. (it's on a localhost, there is no real connection problem)

Just a little more issue, but maybe you can just leave it as it is: when using taxonomy context and opening dynamically a taxonomy term, the appropriate block is, of course, not loaded.

Another issue, now I hope it'll be the last: I'm using the question module and the subscriptions module. When I click on the "My subscriptions" link on the left, he should open the page dynamically, but he fails. The link is the following, for instance: http://127.0.0.1:12345/?q=admin/settings/dynamicload#subscriptions, similar for the question module. The error firefox is giving me is: unable to load page.

Well, now you know everything, I hope this might be somehow useful for you, at least a little bit considering the great work you've been putting online here!

Have a nice day,

Felix.