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 6731969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:35:34+00:00 2026-05-26T10:35:34+00:00

I have a page that contains some JS to update the browser history (

  • 0

I have a page that contains some JS to update the browser history (pushState(), using HTML5). As IE8 does not support HTML5 users are being told that the page contains an error. While this doesn’t deminish the functionality of the page, it doesn’t look very professional, so I’m wondering if there is a check to see if the users browser supports HTML5 before running this code?

<script type="text/javascript">
/** Update history.state() (for back/forward links) */
var object = {
    ajax_string: '<?php echo make_ajax_string(); ?>',
    security: '<?php echo wp_create_nonce('updated-page-nonce'); ?>',
};
window.history.replaceState(object, '<?php echo $post->post_title; ?>', '<?php echo get_permalink($post->ID); ?>');
</script>

Thanks.

  • 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-05-26T10:35:34+00:00Added an answer on May 26, 2026 at 10:35 am

    You can check if the replaceState method is available before running the code:

    if(window.history.replaceState) {
        //Your code
    }
    

    If replaceState is undefined (which will be the case in browsers that do not support it) then the statement evaluates to false and the code is not executed.

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

Sidebar

Related Questions

I have an HTML page that contains some filenames that i want to download
I have a page that contains several forms, by submitting each one of them,
i have a page that contains several submit buttons however i only want one
I have a page that contains an iFrame point to a URL with parameters.
I have an aspx page that contains a checkbox, and a button. The button
I have an ASP.Net page that contains a <div> with an <img> tag within.
I have an ASP.NET page that contains two div's. Both have search fields and
I have a pre tag within my page that contains quite a bit of
I have a ASP.NET web page that contains many textboxes. Each textbox has a
I currently have a product view page that contains an MVCContrib HTML Grid with

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.