Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Thread Closed 
Dynamic Javascript Loading
11-01-2009, 08:44 PM
Post: #1
Dynamic Javascript Loading
Dynamic Javascript Loading has been mentioned in the new firmware threads, but I though it needs a thread here for a wider audience...

Presumably the idea is to delay parsing/processing of javascript until it's actually needed. Thus decreasing the initial page load time.

Has anyone got this working? (I'm guessing yes since one particular jukebox requires latest firmware? )

The wiki page needs an update.

http://www.networkedmediatank.com/wiki/i...ipt_on_NMT

Previous chatter :

http://www.networkedmediatank.com/showth...#pid101647

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
11-01-2009, 08:47 PM
Post: #2
RE: Dynamic Javascript Loading
gfb and i have been discussing this a bit.

He's much further along in the process then i am. I'm just begining to understand its capabilities. He's been very patient with me Smile

Pannasonic Plasma 50" -->HK254-->Emotiva xpa-5 & upa-2
A100 w/ 500gb HDD, A200 w/ mn100, c200 w/ 2.5" 250gb
Calm 2.1, YAMJ - Redefined 1.8a skin, Music Jukebox 8
WHS ex490 w/ 2.5tb's
Find all posts by this user
11-02-2009, 02:59 PM (This post was last modified: 11-02-2009 03:34 PM by gfb107.)
Post: #3
RE: Dynamic Javascript Loading
I've got it working, but I have much more to do before I have a skin ready for release.

The point is not to delay the loading/parsing of javascript. The idea is to pass information between the html pages to keep track of the context in which the user is browsing, and use that information to dynamically load the javascript information about that context in order to provide enhanced functionality. And do it in a way that maximizes performance by minimizing the amount of data loaded for each page.

Here's a simple example.

Say I'm browsing the "Genres : Adventure" index (Genres_Adventure_1.html"). I might click into the details for one of these movies, then use the next movie link expecting to see the next Adventure movie, but the way it works now I end up seeing the next movie in my entire collection instead. The detail page isn't aware of the index the user is browsing. And there's no way to know ahead of time which index the user is browsing, because it is dynamic based on the path the user took to reach that page.

With dynamic javascript loading, we can pass as parameters in the URL the name of the index being browsed and the current movie number within that index. The detail index can then parse those parameters into javascript variables and determine that it should load the javascript file for the "Genres : Adventure" index, which might contain an array listing the names of the detail files for the movies in that index. The javascript code can also compute the offset of the next/previous movies (by adding/subtracting 1, with boundary checking) so it can set the next/previous links the correct detail file, but also passing the current index and adjusted movie number in the URL. This way the user can browse to the next movie repeatedly, always staying within the context on the current index.

Of course this could have been done without dynamic loading, but would have required loading ALL the indexes rather than just the current one.

iSkin(2) (Donate) | PlexNMTHelper (Donate)
Visit this user's website Find all posts by this user
11-02-2009, 04:27 PM (This post was last modified: 11-02-2009 04:27 PM by lordy.)
Post: #4
RE: Dynamic Javascript Loading
Thanks, perhaps my language was not clear. (being ex compiler writer I tend to see things from that point of viewSmile ), but I gather it is simply to only load javascript that is required at the time. Whether that js contains more code or data etc. we dont want to waste time having the JS interpreter parse it unless the user is actually about to use it. On-Demand java modules if you like?

Oversight: Jukebox | FeedTime: Automatic nzbs
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  NFO Manager v1.0.4 Beta Released Nov 11th - With Dynamic JukeBox vaidyasr 76 36,449 01-12-2011 02:12 PM
Last Post: mfsav2
  New to NMT Javascript - HELP! GibParadox 16 4,419 07-02-2010 08:12 PM
Last Post: excal
  No Video output after loading beanyman1000 3 1,620 04-12-2010 06:56 PM
Last Post: spawn
  a-110 not loading up when lan cable is plugged in. miikkax 0 1,108 03-17-2010 07:11 PM
Last Post: miikkax
  taimador - standalone dynamic jukebox rony 11 5,868 02-28-2010 07:00 PM
Last Post: rony
  NTFS 3g not loading. What am i doing wrong? Gemni69 9 3,404 12-06-2009 05:11 AM
Last Post: lundman
  A110 Wont Fire Up After Loading Symbol m2dmhot 0 1,037 11-22-2009 06:45 AM
Last Post: m2dmhot
  No TV signal after "Loading...." kbca 1 1,132 11-16-2009 03:57 PM
Last Post: daniel_owen_uk
  Stream Media File using JavaScript MikeMcr 0 1,364 11-07-2009 01:16 PM
Last Post: MikeMcr
  slow loading oxonian 5 2,088 11-02-2009 05:14 PM
Last Post: laureck

Forum Jump: