1

I am trying to load a html, which will act as a header . The code that i have for this purpose is :

<html>
    <head>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
        <script>
            function loadContent(divName,pageURL) {
                alert(divName+"--"+pageURL);
                $("#" + divName).load(pageURL);
            }
            $(document).ready(function() {
                loadContent('header','D:\\cracker\\RollingMenu\\index.html');
            });
        </script>
    </head>
    <body>
       <div id="header"></div>
    </body>
</html>

Here, i can see the alert that is popping up, when the page loads, but the header is not coming up in the page . However, when i try to access the header(index.html) using the url that i am passing , i can see the html getting rendered.

Any one , any ideas as to what i may be doing wrong here ?

The Dark Knight
  • 5,455
  • 11
  • 54
  • 95

0 Answers0