yea but the javascript parser functions i coded were page specific so i decided to split them up so that they would be modular
home.js would have its own code to parse the content off game.pl?home
attack.js would hold the attack code etc
...
also I didn't like having say pullHome(data) and pullArmory(data) and such for each page on one javascript file. If i had it all on one file and i updated part of the code say I updated pullHome the user wouldve had to redownload the whole monolithic javascript library i coded vs just downloading a new home.js file for function only . hope this explains why i didn't implement it as just pullAttack();
anyways with this in mind I then had in my index.html
<script src="script/home.js">
<script src="script/attack.js">
...
but this had a http overhead and so came out slower than the monolithic one i had,
so then I decided I'd have the thing dynamically import the xxx.js file when needed and cache it instead of it preloading all the js files at load time
so for me its actually like
<a href="
http://example.org/#attack" onclick="sload('attack');">Attack!</a>
the sload function dynamically imports/runs the .js page
so it really is :p what i stated it to be
index calls sload('xxx') -> xxx.js imported runs calls content ->
index has new content <- received data is parsed <- sends content back
wondering if any1 here knows a better design or could point out to me why my design sucks
thx anyways