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

  • Home
  • SEARCH
  • 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 8343355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:02:00+00:00 2026-06-09T06:02:00+00:00

This function updates my content using the .load method from JQuery. The code works

  • 0

This function updates my content using the .load method from JQuery. The code works as intended on Google Chrome and Mozilla Firefox, but does not work at all in IE8 nor IE9.

Here is its content:

 $(function(){

   var newHash='';
    $contentwrapper = $("#contentwrapper");

    $("nav").delegate(".menuOptions", "click", function() 
    {
        window.location.hash = $(this).attr("href");
        return false;
    });

    $(window).bind('hashchange', function()
    {
        newHash = window.location.hash.substring(1);  
        $contentwrapper.load(newHash + " #contentcolumn");
        setTimeout(TitleUpdater, 200);
    });
 });

 function TitleUpdater()
 {
     top.document.title=$("#contentcolumn").attr("title");
 }

I would like to know how to make this code compatible with Internet Explorer! Thank you.

Edit: On Firefox and Chrome, this code only replaces one big <div id="contentcolumn">...</div> and all the style around stays the same as it was before the script execution. While IE8 and IE9 just remove ALL my html code by <div id="contentcolumn">...</div> (it even writes over the head and body tags). This is really weird!

Here is index.html:

<!DOCTYPE html>
<html>
    <head>
        <title>Vladi Manaev</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="css/bagums.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    </head>

    <body>
        <div id="maincontainer">

            <div id="topsection">
                <div id="banner"></div>
                <div class="navbar">
                    <div class="navbar-inner">
                        <div class="container">
                            <nav> 
                                <a class="brand" href="">Bagums.com</a>
                                <ul class="nav">
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Basic Tutorials<b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <li><a class="menuOptions" href="BasicTutorials/CTutorial.html" name="CTutorial">C</a></li>
                                            <li><a class="menuOptions" href="BasicTutorials/CppTutorial.html" name="CppTutorial">C++</a></li>
                                            <li><a class="menuOptions" href="BasicTutorials/CsharpTutorial.html" name="CsharpTutorial">C#</a></li>
                                            <li><a class="menuOptions" href="BasicTutorials/JavaTutorial.html" name="JavaTutorial">Java</a></li>
                                            <li><a class="menuOptions" href="BasicTutorials/OtherTutorials.html" name="OtherTutorials">Others</a></li>
                                        </ul>
                                    </li>
                                    <li class="dropdown">
                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">My Projects<b class="caret"></b></a>
                                        <ul class="dropdown-menu">
                                            <li><a class="menuOptions" href="MyProjects/CProject.html">C</a></li>
                                            <li><a class="menuOptions" href="MyProjects/CppProject.html">C++</a></li>
                                            <li><a class="menuOptions" href="MyProjects/CsharpProject.html">C#</a></li>
                                            <li><a class="menuOptions" href="MyProjects/JavaProject.html">Java</a></li>
                                            <li><a class="menuOptions" href="MyProjects/Others.html">Others</a></li>
                                        </ul>
                                    </li>

                                </ul>

                                <ul class="nav pull-right">
                                    <li class="dropdown-toggle"><a class="menuOptions" href="OtherPages/Links.html">Links</a></li>   
                                    <li class="dropdown-toggle"><a class="menuOptions" href="OtherPages/Contact.html">Contact</a></li>
                                    <li class="dropdown-toggle"><a class="menuOptions" href="OtherPages/About.html">About</a></li>
                                </ul>
                            </nav>
                        </div> <!-- container -->
                    </div> <!-- navbar-inner -->
                </div><!-- navbar -->
            </div><!-- topsection -->

            <div id="contentwrapper">
                <div id="contentcolumn" title="Vladi Manaev">
                    <div id="mainPostsTitle">Latest News</div>

                    <div class="postWrapper">
                        <div class="post">
                            <div class="postTitle"><div class="postTitleTxt">Third post on website</div></div>
                            <div class="postInfo"> Aug 4, 2012 @ 7:23 pm</div>
                            <div class="postContent">
                                <p>
                                    CONTENT
                                </p>
                            </div>
                        </div>
                    </div>

                    <div class="postWrapper">
                        <div class="post">
                            <div class="postTitle"><div class="postTitleTxt">Second post on website</div></div>
                            <div class="postInfo"> Aug 4, 2012 @ 7:22 pm</div>
                            <div class="postContent">
                                <p>
                                     CONTENT
                                </p>
                            </div>
                        </div>
                    </div>

                    <div class="postWrapper">
                        <div class="post">
                            <div class="postTitle"><div class="postTitleTxt">First post on website</div></div>
                            <div class="postInfo"> Aug 4, 2012 @ 6:48 pm</div>
                            <div class="postContent">
                                <p>
                                       CONTENT
                                </p>
                            </div>
                        </div>
                    </div>

                </div><!-- contentcolumn -->
            </div><!-- contentwrapper -->

            <div id="footer"> 
                <nav>
                    <div> Copyright &copy; 2012 created by <a class="menuOptions" href="OtherPages/Contact.html"> Vladi Manaev</a></div>
                </nav>
            </div><!-- footer -->

        </div><!-- maincontainer -->

        <!-- Placed at the end of the document so the page load faster -->
        <script type="text/javascript" src="scripts/jquery-1.7.2.js"></script>
        <script type="text/javascript" src="scripts/bootstrap-dropdown.js"></script>


    <script>
     $(function(){

       var newHash='';
        $contentwrapper = $("#contentwrapper");

        $("nav").delegate(".menuOptions", "click", function() 
        {
            window.location.hash = $(this).attr("href");
            return false;
        });

        $(window).bind('hashchange', function()
        {
            newHash = window.location.hash.substring(1);  
            $contentwrapper.load(newHash + " #contentcolumn");
            setTimeout(TitleUpdater, 200);
        });
     });

     function TitleUpdater()
     {
         top.document.title=$("#contentcolumn").attr("title");
     }

</script>

    </body>
</html>
  • 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-09T06:02:03+00:00Added an answer on June 9, 2026 at 6:02 am

    When i changed my href to start with # like this:

    <a class="menuOptions" href="#BasicTutorials/CTutorial.html" name="CTutorial">C</a>
    

    …

    It start working on IE as well!
    My guess is that window.location.hash does not work on IE… and when i added “#” by hand it solved the problem.

    Thanks everyone for trying to help !

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

Sidebar

Related Questions

I am loading a set of images from another page using jquery load() function.
i am using the code: $('#stream').delegate('.load','click',function(){ //DO ACTIONS HERE }); but when the content
I have this code: function content(){ $(#23).load(http://www.example.com/index.html, alert('responded')); } Which is triggered when the
I am using this code to post some data $('.update_btn').live(click,function() { var ID =
I'm using current jQuery plugin (address) and I have this code (I'm using SEO
I have a script that loads content using load() via a click function. I'd
I have a code <div id=content></div> I load into this content my Ajax content
The code i current have is this. function update (){ latest_id = $('#image:first').data('position'); /*
This function works fine: std::string get_str() { return std::get<0>( make_tuple(std::string(hi)) ); } But if
This function works as it should, window.setInterval(function(){ var active = $('#frontpageControls a.active'); var next

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.