How do I get all my pages to be updated automatically when I update a page? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
So, as I was making my website, I started to have many pages. So, I wanna ask today, if ya'll know anyway way how I can make a change to a page of my website, and those changes be apply to my other pages automatically. For example, if I make a change to my nav bar of my website, I don't wanna have to go to every single page and and do it manually, I wanna know if there is a way how I can make a change to the nav bar in one of the web page, and get the other pages get the updates automatically. I would very much appreciates any advice, thank you.

You can just write your navbar code into a separate file and include it wherever you need navbar. This way if you change the main navbar.php file it will reflect in every other page that includes navbar.php

Related

Best way to create new window/page/modal for list of JSON data [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Thank you in advance for your help!
For a project I'm building a page for an animal shelter. On a page I have a list of available animals generated from JSONP data, with a picture and basic data.
I would like to create something so that if the user clicks on the animals picture, it shows the full info for the animal, and all the available pictures.
I'm not sure what the best way to do this would be? A modal? A new html page? We're only using front end (html, CSS, javascript).
you can use bootsrap modal as it fits perfectly to your needs and you can customize it the way you want :
https://v4-alpha.getbootstrap.com/components/modal/
Bootstrap modal is best to show full details.Because users dont want to load pages all the time.
For Bootstrap modal go to this link
https://www.w3schools.com/bootstrap/bootstrap_modal.asp
When you want to display with comments of that blog use new html page.

How can I get the same effect on my webpage? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So I've seen a mouse-hover effect on 2 websites so far and I really like it.
This is the effect I'm talking about.
I'd be grateful if somebody can tell me how to get that effect on my webpage.
It only appears under your cursor when you hover over the page.
The site you have linked in the comments uses the HTML canvas element. But You can simply use already existing libraries for that effect.
Examples mentioned in the comments:
http://jnicol.github.io/particleground/
http://github.com/VincentGarreau/particles.js
Simply, Go to the webpage you wanted to Copy it's effects or anything from it
Right click, View page source
If the effect is made by Css, you will find it in stylesheets tab
If it's using jQuery/Js, Search the head for <script> , Read them and copy the effect (assuming that you understand js/jquery
For more simplicity, use Firebug, open it and just point the cursor at the item you want to see it's source.
But, actually
You can find it at github Here
Change what you want.

How to efficiently maintain a navigation bar? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I was wondering how to efficiently maintain a navigation bar. Based on my understanding right now, we just include the html code for the bar at each individual webpage. However, if I had many webpages I would need copy and rewrite the html code for each page. And if I would want to add or remove links I would need to change and update all of the pages. Is there a more efficient way to do this?
There are a lot of ways we can achieved this but here are the simplest I can think of right now.
1. Using PHP include_once function
You can use php for that. Simply store your navigation in a file called header.php for example, then include_once('header.php'); in your page. Make sure your page have a .php extension instead of .html
2. Using jQuery
If you want to stay with the current language(HTML,CSS,Javascript), you can also use JQuery load function.
$("#header").load('header.html');
It is better to run this after the DOM is ready:
$(document).ready(function() {
$("#header").load('header.html');
}
Somewhere in your code, you should have <div id="header"> for the script to inject the nav in header.html
what they do is that they load the page which is called from the server, besides the navigation bar. like either you can call the page in an iframe or you can run a script that could render the elements besides the navigation bar. That's how they could maintain the navigation bar

How to keep banner animations running while changing webpages [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
To start off, here's a picture of the website project:
http://i.imgur.com/FbdUmpp.png
The top image is one of the cycling images in the website banner. I'd like to make my website a bit more polished. When the user navigates to a new webpage, the banner animation will restart. I was wondering how I could stop this from happening.
How can I keep the banner from restarting when a user switches a
webpage?
What's the exact name of what I'm trying to accomplish? (I can't seem to find any information about this subject.)
My knowledge is limited to HTML, CSS, a little bit of PHP and JavaScript. I don't mind learning a new language in order to achieve this.
Thanks in advance!
Well the animation restart is due to the content being reloaded when you land on the new page. There is no way around that specifically. However you can change the content on the screen without actually navigating away. Look into AJAX to accomplish this. Have an AJAX call get the new data that you want to view and place it on the current screen in place of the old data. This way you will still get the new information and the animation of the banner will continue without stops or restarting.

How to create different versions of a website depending on where someone comes from? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
This is a little hard to explain.
I want to have a separate home page depending on where people are coming from. For example, if they come from FaceBook, I'd like a special home page for FaceBook users. If they come from Google, I'd like another home page for them.
Here's an example of a website that does this. It will be the normal site at first, but once you've clicked the link thru FaceBook, your browser will only load the FaceBook version.
Normal:
http://www.protectyourhome.com/
From FaceBook:
http://www.protectyourhome.com/Facebook
Any ideas on the codes I'd need for this?
I figured out another way to do this, it's not exactly what I wanted but I made a copy of the website with the index page as indexFB.php and only linked that version of the site with Facebook.

Categories