Activity Stream
48,167 MEMBERS
62147 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 2 of 2
  1.     
    #1
    Member

    Default 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: 5
    My previous username was kaed

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    anadesigns.net
    No 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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. can anyone code this from PSD to html for me?
    By _brazzO in forum Web Development Area
    Replies: 2
    Last Post: 21st May 2012, 08:45 PM
  2. Help about HTML Code for a Box
    By Deadmau5 in forum Web Application/Script Support
    Replies: 1
    Last Post: 19th Nov 2011, 12:52 PM
  3. [Question]Automatically adds html file to .rar file
    By blazer345 in forum Webmaster Discussion
    Replies: 3
    Last Post: 1st Aug 2011, 02:45 PM
  4. [Buying] html code
    By rakicko in forum Completed Transactions
    Replies: 5
    Last Post: 25th Jan 2011, 03:30 PM
  5. How To Import an SQL file with phpmyadmin
    By 88power88 in forum Tutorials and Guides
    Replies: 1
    Last Post: 16th Oct 2010, 06:09 PM

Tags for this Thread

BE SOCIAL