shiv chhabra
shiv chhabra

Reputation: 43

communicate two html page on lan without installing any software

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

Answers (2)

CoderSam
CoderSam

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

Mohammed Akhtar Zuberi
Mohammed Akhtar Zuberi

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.

Current Structure

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.

Current Problem

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.

Computer A now hosting the HTML

Once HTML modified, in real-time it will be available to Computer B.

enter image description here

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

Related Questions