Results 1 to 2 of 2
-
2nd Jul 2012, 03:45 PM #1OPMember
Import code into html file without using php?
First off, I cannot use PHP because for some reason it doesn't work with the server I'm on. If I could use PHP I'd be done with this already but I'm not allowed to change this or update the server in any way so I need to somehow find a workaround for the following problem.
My problem is that I need to store the side navigation in another file that every html file loads the side navigation from so when you want to change a menu item you don't have to edit about 50 html files to change the menu. I can use javascript though, so I was wondering if through js you could get the side navigation code from one file, assign it to a var, and insert the var into all of the other html files. Before I even get started trying to code this I need to know, is this even possible?
EDIT: found a way to do it kind of:
Code:var txtfile = new XMLHttpRequest(); var lines txtfile.open("GET", "url" , true); txtfile.onreadystatechange = function(){ if (txtfile.readyState === 4){ if (txtfile.status === 200){ alltext = txtfile.responseText; lines = txtfile.responseText.split("\n"); for (var i = 0; i < lines.length; i++){ document.write(lines[i]); } } } } txtfile.send(null);
Connor Reviewed by Connor on . Import code into html file without using php? First off, I cannot use PHP because for some reason it doesn't work with the server I'm on. If I could use PHP I'd be done with this already but I'm not allowed to change this or update the server in any way so I need to somehow find a workaround for the following problem. My problem is that I need to store the side navigation in another file that every html file loads the side navigation from so when you want to change a menu item you don't have to edit about 50 html files to change the Rating: 5My previous username was kaed
-
4th Jul 2012, 03:18 PM #2MemberWebsite's:
anadesigns.netNo offense but why would you be on a server that PHP doesn't work on? That's such a basic function. I would move to another host if possible. It will make life easier for you in the long run.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
can anyone code this from PSD to html for me?
By _brazzO in forum Web Development AreaReplies: 2Last Post: 21st May 2012, 08:45 PM -
Help about HTML Code for a Box
By Deadmau5 in forum Web Application/Script SupportReplies: 1Last Post: 19th Nov 2011, 12:52 PM -
[Question]Automatically adds html file to .rar file
By blazer345 in forum Webmaster DiscussionReplies: 3Last Post: 1st Aug 2011, 02:45 PM -
[Buying] html code
By rakicko in forum Completed TransactionsReplies: 5Last Post: 25th Jan 2011, 03:30 PM -
How To Import an SQL file with phpmyadmin
By 88power88 in forum Tutorials and GuidesReplies: 1Last Post: 16th Oct 2010, 06:09 PM
themaPoster - post to forums and...
Version 5.11 released. Open older version (or...