rumca-js / Django-link-archive

Self-hostable link database
https://rumca-js.github.io
GNU General Public License v3.0
72 stars 4 forks source link

Analyse if we can dynamically load body of the page #400

Closed rumca-js closed 1 month ago

rumca-js commented 1 month ago

This would limit amount of refreshes between searches.

At least for:

from django.shortcuts import render from django.contrib.auth.decorators import login_required

@login_required def load_dynamic_html(request): return render(request, 'dynamic_content.html') # Return the HTML content

error: function(xhr, status, error) { if (xhr.status === 403) { // Redirect user to the login page or show a message window.location.href = '/accounts/login/?next=' + window.location.pathname; } else { console.log('Error loading dynamic content:', error); } }

<!DOCTYPE html>

Django jQuery Dynamic Loading

Loading data....