Question

I am loading few aspx pages into a layout page using jquery , It is not working in IE7 and I am getting the error

unexpected call to method or property access

The Layout page

<%@ Page Language="C#" AutoEventWireup="false" CodeFile="layout.aspx.cs" Inherits="layout" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/> 
    <title></title>
    <script src="script/jquery-1.9.1.min.js" type="text/javascript" ></script>
    <script src="script/myScript.js" type="text/javascript" ></script>
    <link href="style/theme.css" rel="stylesheet"></link>
</head>
<body class="layout">
   <header class="header"></header>
   <section class="content"></section>
   <footer class="footer"></footer>
</body>
</html>

myScript.js

$(function(){
    $(".layout .header").load("header.aspx");
    $(".layout .footer").load("footer.aspx");
    $(".layout .content").load("pages/home.aspx");
});

Header page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="header.aspx.cs" Inherits="header" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"> 
    <title></title>
</head>
<body>
   header
</body>
</html>

The rest of the pages are similar to header page. Any idea what has gone wrong?

PS: load works fine, so I doubt that is the one causing the issue

Was it helpful?

Solution

IE7 is too old to understand <section><header><footer>.

Use <div> instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top