Reputation: 43
I want to design a tool for my office where if I make any changes in my HTML file dynamically it should automatically reflect on second HTML file, on another computer, from the same shared drive that we all access.
I can't install any software right now, so is there any possible way to do it without installing database and server? If not can you please suggest which backend language and database would be most appropriate to make this kind of tool. I just want know the direction rest I will learn and code.
Upvotes: 1
Views: 374
Reputation: 179
you have to read the file for amendment and then use jquery setinterval function to check the amendment and load the changes if any to the second html. I can give you example if you want.
Example In jquery.
var ajax_the = function (){
//your function to read the file
};
var timeInterval = 1000*60*2; //for 2 min execution
setInterval(ajax_the,timeInterval);
Upvotes: 1
Reputation: 658
HTML is only the front-end language and displays the output with CSS formatting. If I understood correctly, your current structure is as below.
Now what you are looking for is making changes on Computer A HTML that reflects automatically on Computer B. Like I mentioned earlier, HTML is only front-end language, so will only display the local copy. Your current problem is this.
Now how to solve this? You actually don't require any backend programming language or database to solve this as far as you have a static web page/HTML. The only thing what you have to do is to give access to your copy of HTML on your computer, (Computer A in this explanation) to Computer B. This can only be achieved by hosting your computer as a server within your local network.
To do this, XAMPP is one of the best solutions available to you. Install it on Computer A, which will have the original HTML copy.
Follow the instructions on how to store files in htdocs folder in the XAMPP instructions. In case you face any problem, feel free to ask.
Now once the server is installed, you will be able to browse your HTML on your computer by typing http://localhost/your_html_directory/index.html
Now below is the initial case when you have original HTML file.
Once HTML modified, in real-time it will be available to Computer B.
Please note that the IP address in red is Computer A IP address that Computer B will use in the URL instead of localhost.
Since you will be connected to a WiFi connection with a number of a devices connected, therefore every time you will restart Computer A, the IP address will change.
To overcome this problem, it is suggested to host your HTML on a computer that mostly remains powered on.
This solution will also work on LAN. WiFi is better if you want the HTML to be accessed by mobile devices as well.
Hope this answers your question.
Upvotes: 1