JesseToxik Posted April 24, 2013 Share Posted April 24, 2013 Is javascript navigation effective and smart?In one of my old web pages I used javascript for navigation. The code is listed below.I have knowledge of PHP includes. Currently I do not have web hosting which allows PHP(bills are tight so I opted for temporary free hosting). Would my below code be a good temporary fix until I can pay for hosting and use PHP includes?Are there any other methods?I appreciate all the help and/or ideas. var arrow = '<span>» </span>'; var clearance = 0; home = new Array(); home[1]= "<span class='asep'>Welcome</span>"; home[2]="<a href='#'>"+arrow+"Home</a>"; home[4]="<a href='http://safepiercing.org/en/piercing/body-aftercare' target='_blank'>"+arrow+"Piercing Aftercare [APP]</a>"; home[5]="<a href='#'>"+arrow+"Contact Us</a>"; computers = new Array(); computers[0]="<span class='asep'>Body Jewelry</span>"; if(clearance == 1) { computers[1]="<a href='#'>"+arrow+"Clearance</a>"; } computers[2]="<a href='#'>"+arrow+"New Arrivals</a>"; computers[3]="<a href='#'>"+arrow+"On Sale</a>"; computers[4]="<a href='#'>"+arrow+"Dermal Anchors</a>"; computers[5]="<a href='#'>"+arrow+"Barbells & Tongue Rings</a>"; computers[6]="<a href='#'>"+arrow+"Navel Rings</a>"; computers[7]="<a href='#'>"+arrow+"Non-Piercing Jewelry</a>"; computers[8]="<a href='#'>"+arrow+"Curved & Eyebrow Rings</a>"; computers[9]="<a href='#'>"+arrow+"Labret & Monroe Rings</a>"; computers[10]="<a href='#'>"+arrow+"Nipple Rings</a>"; computers[11]="<a href='#'>"+arrow+"Horse Shoes</a>"; computers[12]="<a href='#'>"+arrow+"Plugs & Tunnels</a>"; computers[13]="<a href='#'>"+arrow+"Guaged Tapers</a>"; computers[14]="<a href='#'>"+arrow+"Captive Bead Rings(CBR)</a>"; computers[15]="<a href='#'>"+arrow+"Twists & Hoops</a>"; computers[16]="<a href='#'>"+arrow+"Nose Rings</a>"; computers[17]="<a href='#'>"+arrow+"Retainers</a>"; computers[18]="<a href='#'>"+arrow+"Body Jewelry Parts</a>"; computers[19]="<a href='#'>"+arrow+"Skin Divers</a>"; computers[20]="<a href='#'>"+arrow+"Cartilage & Tragus</a>"; computers[21]="<a href='#'>"+arrow+"Fake Plugs & Tapers</a>"; computers[22]="<a href='#'>"+arrow+"316L Stainless Steel</a>"; computers[23]="<a href='#'>"+arrow+"Surgical Steel</a>"; computers[24]="<a href='#'>"+arrow+"Titanium Body Jewelry</a>"; computers[25]="<a href='#'>"+arrow+"Acrylic Body Jewelry</a>"; computers[26]="<a href='#'>"+arrow+"Organic Body Jewelry</a>"; computers[27]="<a href='#'>"+arrow+"Bio-Flex/PTFE</a>"; control = new Array(); control[1]="<span class='asep'>User Controls</span>"; control[2]="<a href='#' onclick='window.print(); return false'>"+arrow+"Print This Page</a>"; control[3]="<a href='#' onclick='addbookmark(location.href,document.title);'>"+arrow+"Bookmark Us</a>"; if(navigator.appName == "Microsoft Internet Explorer") { control[4]="<a href='#' onclick='setHomepage(\"http://google.com\");'>"+arrow+"Set As Homepage</a>"; } function writeLinks() { document.getElementById('homelinks').innerHTML = home.join(""); document.getElementById('computerslinks').innerHTML = computers.join(""); document.getElementById('usercontrol').innerHTML = control.join(""); } setTimeout(writeLinks, 0); // Fires the function on page load without stopping other loads Quote Link to comment https://forums.phpfreaks.com/topic/277276-javascript-navigation/ Share on other sites More sharing options...
Adam Posted April 25, 2013 Share Posted April 25, 2013 (edited) There's plenty of hosts around that provide free hosting with PHP. As for that code, just delete it. Ignoring the many issues with it, JavaScript should never be used like that Edited April 25, 2013 by Adam Quote Link to comment https://forums.phpfreaks.com/topic/277276-javascript-navigation/#findComment-1426502 Share on other sites More sharing options...
JesseToxik Posted April 25, 2013 Author Share Posted April 25, 2013 Do you have any free host suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/277276-javascript-navigation/#findComment-1426656 Share on other sites More sharing options...
Adam Posted April 25, 2013 Share Posted April 25, 2013 I can't recommend any as I haven't used free hosting for quite a while. I guess give the first result a go, 000webhost.com? Can always try a different one if it doesn't work out. Quote Link to comment https://forums.phpfreaks.com/topic/277276-javascript-navigation/#findComment-1426659 Share on other sites More sharing options...
JesseToxik Posted April 25, 2013 Author Share Posted April 25, 2013 I'm trying bytehost.com They allow PHP includes which is making life so so much easier.Only thing I am hating is converting my JS to PHP but thats my fault lol. Quote Link to comment https://forums.phpfreaks.com/topic/277276-javascript-navigation/#findComment-1426671 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.