Should I take this to mean no one's quite sure? I know it's kinda rude of me to throw a chunk of code up like that, but I'm pulling my (prematurely gray) hair out.
On Oct 5, 2:09 pm, Fluffica <thomas.james.winstan...@googlemail.com> wrote: > Good Morning/Afternoon (depending where you are) > > I would usually hate to post chunks of code like this, but I may be > about to break my monitor. > > I've written a chunk of code, which on an address change, loads page > content either into a black, or white div. The address change event is > working, and the if statement to decide if the page is black or white > is working. However the simple .load statement that follows isn't. I'm > using the address pluggin (http://www.asual.com/jquery/address/docs/), > which I suppose could be doing harm. But I can't see how. > > Again, I apologise for posting up what is surely one of those > "Designers trying to code" questions, but would be very thankful for > your help. Will even buy you a drink* > > $.address.change(function() { > alertSystem ("Address change!"); > var currentAddress = $.address.path(); > alertSystem ("Current address is "+currentAddress); > if (currentAddress.substring(0,5) == "/work"){ > alertSystem ("This page is black"); > $("#blackArea").load(currentAddress +" > .blackContent", function(){ > alertSystem ("Content has been loaded into > the black area"); > fnc_openBlackSite (); > }); > }else{ > alertSystem ("This page is white"); > $("div#pageArea").load(currentAddress +" > .pageContent",'ts=' + Date > (), function(responseText, textStatus, XMLHttpRequest){ > alertSystem ("Content has been loaded into > the white area"); > fnc_openWhiteSite (); > }); > } > if (currentAddress.substring(0,6) == "/index"){ > $("a#smallLogo").hide(); > }else{ > $("a#smallLogo").show(); > } > }); > > Tom > *if you're in London.