Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8891669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:48:12+00:00 2026-06-14T22:48:12+00:00

I’ve created a comics website, http://www.hittingtreeswithsticks.com/ , where if you click on a comic

  • 0

I’ve created a comics website, http://www.hittingtreeswithsticks.com/, where if you click on a comic thumbnail it will take you to the full size of the image (the viewimage.php template).

On the viewimage.php template, I’m using javascript/jquery to cycle through images I’ve stored in an array so that users will not have to reload the page each time.

There seems to be two problems with this:

1) I also have a “like/dislike” feature I’d like to add… so that you can vote per image, as well as a facebook like button (so the user can like PER IMAGE). Currently, since jQuery is cycling through the images, it’s not updating the id for that image you clicked on. (In this image, if I press right arrow key to go next, the id should increment to 35).

enter image description here

enter image description here

2) Eventually I’d like to make money off of Ad Revenue. Sources say that if I use jQuery to get the next image, instead of reloading the page, the Ad won’t be refreshed… and I’ll generate a lot less ad revenue.

So, my question is… is it possible for Jquery to handle these issues, or do I have to do page refreshes to increment the IDs and refresh the Ads?

Thanks!

EDIT: I’ve added in

window.history.pushState(null, null, 'http://www.hittingtreeswithsticks.com/?action=viewimage&site=comics&id=imgIndex');

Code (this doesn’t seem to be working, and in fact blocks the “next” code from working)

    $("#next").click(function() {
        imgIndex++;
            if (imgIndex > imgArray.length-1) 
            {
                imgIndex = 0;
            }
            img.src = imgArray[imgIndex];
            window.history.pushState(null, null, 'http://www.hittingtreeswithsticks.com/?action=viewimage&site=comics&id=imgIndex');
    });

UPDATED:

Error:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:48:13+00:00Added an answer on June 14, 2026 at 10:48 pm

    Regarding your first problem, you can use pushState(). At the time you replace the image, you can also update the url. This adds a new history entry and replaces the url in the browser, but doesn’t actually reload the page. Example:

    window.history.pushState(null, null, 'http://www.hittingtreeswithsticks.com/?action=viewimage&site=comics&id=N&cat=&title=TITLE');
    

    (Just replace N and TITLE appropriately here). So that solves that. Note that this is not a jQuery feature, but vanilla javascript.

    Regarding issue 2, it depends on how your ads are set up, but that’s probably the case that they won’t be automatically reloaded. In most cases, you can also reload the ads via javascript, but the specifics would depend upon the details of how your ads are served; you should probably post a separate question asking how to load ads asynchronously via javascript and give the specifics of how your ad server works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT
I have a reasonable size flat file database of text documents mostly saved in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.