Solved

Header bar that doesn't reload with page

Posted on 2014-04-23
8
288 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 110

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding a countdown to HTA 12 92
Link not working 6 41
Can't get cursor to change 3 15
JQuery - Default innerhtml text with keyup function (copy as you type) 3 14
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

685 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