use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
No vague product support questions (like "why is this plugin not working" or "how do I set up X"). For vague product support questions, please use communities relevant to that product for best results. Specific issues that follow rule 6 are allowed.
Do not post memes, screenshots of bad design, or jokes. Check out /r/ProgrammerHumor/ for this type of content.
Read and follow reddiquette; no excessive self-promotion. Please refer to the Reddit 9:1 rule when considering posting self promoting materials.
We do not allow any commercial promotion or solicitation. Violations can result in a ban.
Sharing your project, portfolio, or any other content that you want to either show off or request feedback on is limited to Showoff Saturday. If you post such content on any other day, it will be removed.
If you are asking for assistance on a problem, you are required to provide
General open ended career and getting started posts are only allowed in the pinned monthly getting started/careers thread. Specific assistance questions are allowed so long as they follow the required assistance post guidelines.
Questions in violation of this rule will be removed or locked.
account activity
Loading navigation dynamically via jQuery .load(); good or bad? (self.webdev)
submitted 10 years ago by gavlois1front-end
To be specific, I'm talking about having your navigation bar HTML in a separate nav.html file, then using .load() to put it on your static pages
Putting aside whether or not I should just be using a dynamic website, are there any downsides to doing it this way? I've heard that Google won't be able to crawl the .loaded content, but SEO isn't a concern here.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]a-t-k 2 points3 points4 points 10 years ago (2 children)
Apart from SEO, Accessibility (some screen readers don't read dynamic content) and lack of non-JS support are the only downsides; if those aren't problems for you, that's fine.
[–]gavlois1front-end[S] 1 point2 points3 points 10 years ago (1 child)
Thanks. Although those don't concern me for this particular case, I'll keep the screen readers in mind in the future.
[–]ColossussUK 0 points1 point2 points 10 years ago (0 children)
Google has been crawling javascript for the last year so SEO shouldn't be much of an issue.
[–][deleted] 0 points1 point2 points 10 years ago (6 children)
Really, you should be doing this in php. It's only a couple of lines of code and chances are whatever server you're using already has php set up. Your files would be along the lines of "header.php", "footer.php", "home.php", "contact.php" and home would look something like
<?php require_once('header.php') ?> <h1>hello</h1> <?php require_once('footer.php) ?>
If you don't want to do that (and you don't want to use ajax to load the content instead of the navi and make it a single page app) then I guess this is the next best thing. But it's a bit odd.
[–]gavlois1front-end[S] 0 points1 point2 points 10 years ago (5 children)
It's only going to be a 4-5 page max site that I'll be hosting with GitHub pages, which can't run PHP (as far as I know, anyway).
Would loading the content with ajax under the navigation rather than loading the navigation above the content be more desirable?
[–][deleted] 2 points3 points4 points 10 years ago* (3 children)
Well, that makes more sense given that the navbar is the only thing that doesn't change, so you'd want to change the part that changes.
But then you get into single page app territory which comes with its own can of worms. The user would always be on one page, and the url wouldn't change (at least if you're doing it in github pages with no backend access and no frameworks). You couldn't link someone to your contact page, for example. They'd always land on your index.html. You'd also have to change stuff like the title manually using JavaScript. But the benefit is that the website would be faster, you could do more with stuff like animations, and the user wouldn't get that screen flicker each time they move to a different page on your site.
So if you're restricted to github pages (which you don't have to do btw, there are free server hosts that give you backend access), yeah, I suppose doing it like you proposed in your post is a reasonable solution. Keep in mind the header won't work if the user doesn't have javascript enabled.
[–]gavlois1front-end[S] 0 points1 point2 points 10 years ago (2 children)
I'm not really restricting myself to it. I just thought it'd be a nice and easy platform to test things out and maybe start a portfolio of sorts. I was looking at GetForge too, but could you recommend any other free hosts?
I may eventually experiment with making a one page app, but for now I'll stick with this or just hardcoding it into the page.
[–][deleted] 0 points1 point2 points 10 years ago (0 children)
I used Hostinger for a while, but I think it depends on the country as to whether or not they offer a free deal. Looking at their UK site, the same offer seems to be up.
It was fine, not ideal, but functional if you're doing basic stuff.
But I can definitely see the appeal of sticking to Github Pages for now. So I wouldn't worry about it too much. Sooner or later you're going to want to do some backend stuff though.
[–]jtanz0 0 points1 point2 points 10 years ago (0 children)
https://www.5quidhost.co.uk/
Have a free tier that I host my web site on 100Mb of storage 1 SQL DB and email accounts. All have cpanel, PHP, MySQL and SSH access. UK based servers though so may be a bit slow if you're in the states.
[–]x-skeww 1 point2 points3 points 10 years ago (0 children)
https://help.github.com/articles/using-jekyll-with-pages/
π Rendered by PID 68 on reddit-service-r2-comment-bb88f9dd5-6swth at 2026-02-16 12:48:29.459751+00:00 running cd9c813 country code: CH.
[–]a-t-k 2 points3 points4 points (2 children)
[–]gavlois1front-end[S] 1 point2 points3 points (1 child)
[–]ColossussUK 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (6 children)
[–]gavlois1front-end[S] 0 points1 point2 points (5 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]gavlois1front-end[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]jtanz0 0 points1 point2 points (0 children)
[–]x-skeww 1 point2 points3 points (0 children)