Click here to Skip to main content
12,953,230 members (67,401 online)
Rate this:
Please Sign up or sign in to vote.
I'm very green to webdesign. I understand coding from over a decade ago, but not done it since and it's slowly coming back to me, but it's all different now as well. Sorry it's long but I need a very specific task.

I have a weekly webcomic that when I update with a new comic, I want my visitors to go straight to the latest comic without having to do anything on their part. I have it so that when you type the home url[^]you are redirected first to "LatestComic.html" which then redirects you to the latest comic's individual page "050.html" or "051.html" etc. I have share and comment buttons on almost all pages so I can keep track of what's most popular and what's not working, but being that they are 3rd party scripts they're tracked through the URL.

The Problem:
Once redirected to the latest numerical url for the newest page, if someone bookmarks it, then the bookmark will save that comic's unique page and every click of the bookmark will take them straight there and not to the latest comic. I need the bookmark to link back to the latest page. What's the easiest way to do that?

I first tried simply duplicating the code for the latest comic on the "LatestComic.html" to avoid the redirect all together, but where I ran into trouble was the share buttons and comments wouldn't reset and the share count and comments would remain from the previous post. Also, as the last latest comic moves down the line it's comments and share count would reset due to it's new unique URL.

Then I tried making an iframe in the "LatestComic.html" and this merely caused a volley of technical issues.

I then duplicated the code in the "LatestComic.html" and created iframes for JUST the share buttons and it almost worked, except it's buggy and if you hover over the share buttons the popups hide behind the borders of the frame.[^]
Here's an example of the Share Buttons directly under the comic.
<iframe src="" id="Share" scrolling="no" frameborder="0""visible" style="border:none; width:850px; height:30px;" allowTransparency="true" ></iframe>>

My last attempt used jQueries to pull the div's from the comic page's url to the Latest Comic cloned code, but I must have butchered the code because it didn't work. I'm also not sure if had I gotten it to work, if the buttons and comments would even READ the different URL, or if it would just copy the code and read the "LatestComic.html" Url just as if I had typed the code into that page. NOTE: I'd post the code here, but honestly it'd probably just embarrass me and if you know how to do it you're better off starting me over from scratch with the code.

What am I missing and is there just simply an easier way to do this?
Posted 8-Mar-12 5:26am
wizardzz 8-Mar-12 11:59am
If I go to a comic site, click to see the latest strip, then bookmark it. I would hope the bookmark would save the link to the specific comic. I hate when bookmarks link to the dynamic page. Just put your latest comic on your front site. If someone bookmarks the front site, they will always get the latest strip.
Ed Nutting 8-Mar-12 14:24pm
Wizardzz is about right though being able to bookmark dynamic pages is good. Might I suggest that you still redirect users to the latest specific comic (because this allows them to bookmark that individual one) but you also add a link (possibly needs javascript - look the following up in Google) that says "Bookmark Latest Comic Page" or something which, if clicked, adds a bookmark for the user that links to your dynamic LatestComic page. Users who add bookmarks will either use your link or they will "get savvy" pretty quickly and add a link to your dynamic page for themselves.

Out of interest, why not embed the latest comic using an iFrame in your home page - I know you said you had problems but I've always found iFrames work just fine if you set them up right. Use an embedded iFrame in your home page that points to your dynamic LatestComic page (which can then redirect the iFrame to the specific comic). This will allow users to bookmakr your homepage for the latest comic which is an even better solution than my last one. Include in the iFrame a "View full page" link or something with target set to "_top" (and any other links that you want to redirect the user's actual browser, not the iFrame) - the target="_top" attribute on "a" (link) tags is the most common problem with iFrames I've found.

Hope this helps and if you have issues with iFrames, please reply wioth what they are and I will see if I can help more,
mark merrens 8-Mar-12 16:18pm
First: I agree with the comments above. If I bookmark a page then that's the page I want to go back to: not another page you think I should go to. If I want to see the latest then I'll navigate to the home page. Second: strip quite amusing. Third: looks like crap in IE and not much better in FireFox: sorry, just don't like the design and the strip is too small in IE. Have you checked the design in various browsers? Some of us quite like IE! :-)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If i bookmark a page i would like to be in the respective page more over to another one, i will find the way from that page to refer in google to check it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 6,429
CHill60 3,490
Maciej Los 3,103
Jochen Arndt 1,975
ppolymorphe 1,920

Advertise | Privacy | Mobile
Web02 | 2.8.170525.1 | Last Updated 28 Mar 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100