Solved

Header bar that doesn't reload with page

Posted on 2014-04-23
8
283 Views
Last Modified: 2014-04-28
I'm trying to figure how to make the header of my page not reload when browsing the site.

An example of what I'm trying to accomplish is the play bar: http://sverigesradio.se

Any plugins or ideas on how that's done?
0
Comment
Question by:N R
  • 3
  • 3
8 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 40018963
server side send only the right part not the header

<body>
<header>
<!-- your header here -->
</head>
<div id="mybody"></div>
</body>

Open in new window

with :

var id = "1";
jQuery("#mybody").load("serverside.php?chunk_page_id="+id);

Open in new window

0
 
LVL 11

Author Comment

by:N R
ID: 40019154
Not sure I understand the above solution.

Could you explain further?

So the non-reloading div would be #mybody?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40019619
no it's the header

#mybody get the "new" page calling serverside.php
serverside.php receive a parameter : chunk_page_id
to know which page to send (echo)
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40020070
No points for this, please, but this design is showing up more and more.  Google has been using it for a couple of years.  Because it uses JavaScript (jQuery) and CSS to create the visual rendering of the web page, it makes programmatic "web scraping" of the content more difficult, thereby protecting the content a little better from script kiddies who would steal without respect to intellectual property rights.
0
 
LVL 11

Author Comment

by:N R
ID: 40020222
Gotcha, so this would be more complicated to add to an existing website then as the entire current page has to be loaded this way while the header is static.  

Are there any performance issues with doing this on bigger sites?  I guess not if google does it?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 40020392
The issue is about SEO
Your site will load faster
0
 
LVL 11

Author Comment

by:N R
ID: 40024598
Ah meta descriptions and such need to be defined outside of the load then?
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
html form to write data to csv 24 95
Error on Add method 1 37
JavaScript: Issue with onClick 5 34
Apply tab index in forms 6 33
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now