Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> [Script] AJAX Pages for search and galleries

 
post Sep 5 2017, 19:31
Post #1
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


As it says in the title, this script makes searching and gallery page switching do ajaxy things.

How searching looks:
(IMG:[i.imgur.com] https://i.imgur.com/4562dbN.gif)

How gallery page switching looks:
(IMG:[i.imgur.com] https://i.imgur.com/UEhYMXE.gif)

If you have any scripts that modify ajax-loaded elements (like me), you can use this event:
CODE
// Example of handling AJAX page load event
document.addEventListener('AJAXPageload', function (e) {
    console.log('Page with href '+e.detail+' was loaded wia AJAX!');
}, false);

This way you can let your scripts know when they should do they code-things.

Script: Attached File  ajaxgalleries1.0.0.js.txt ( 2.97k ) Number of downloads: 161


Hope this helps!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Sep 5 2017, 20:48
Post #2
blue penguin



in umbra, igitur, pugnabimus
***********
Group: Gold Star Club
Posts: 10,045
Joined: 24-March 12
Level 500 (Godslayer)


Pretty neat. Added to the index.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Sep 6 2017, 02:15
Post #3
mozilla browser



Nutscrape Navigator
*******
Group: Gold Star Club
Posts: 2,131
Joined: 22-December 11
Level 500 (Godslayer)


This looks neat, but sorry if I don't understand these new-fangled things.

There's no backend ajax interface, so you still need to load the full html page, parse it to extract the interesting portions, and replace the content in the current page right? Is there a benefit into doing ajax here?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Sep 6 2017, 04:21
Post #4
Simpleton8



Casual Poster
****
Group: Members
Posts: 336
Joined: 2-November 15
Level 264 (Godslayer)


Does this work with EH Highlighter?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

 
post Sep 6 2017, 15:53
Post #5
Extiandr



Newcomer
**
Group: Members
Posts: 55
Joined: 23-July 15
Level 365 (Dovahkiin)


QUOTE(mozilla browser @ Sep 6 2017, 03:15) *

There's no backend ajax interface, so you still need to load the full html page, parse it to extract the interesting portions, and replace the content in the current page right? Is there a benefit into doing ajax here?


Exactly. The thing is you don't need to refresh the page, and it looks smoother.
If you just want to see second page of gallery pages, why refresh the whole page and bump to the top?
Just update the required elements.
You can test yourself how long it takes to go to the 2nd page without the script, and with the script.

QUOTE
Does this work with EH Highlighter?

I don't know how it works, but my script has event that you can hook your script into.
Should work.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 29th April 2024 - 20:24