-1

I am executing following code but i am getting error: "Objected Expected" I checked the code but didnt find any problem.

<!DOCTYPE html>
<html>
    <head>
            <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script>
            $(document).ready(function(){
                 $("#clickme").click(function(){
                     $("#body1").load("http://www.w3schools.com");
                 });
            });
        </script>
    </head>
    <body>
        <div id="header">
            <a href="#" id="#clickme">Click me</a>
            hello
                   </div>
        <div id="body1">
            mid

        </div>
        <div id="footer">
                    hi
        </div>
    </body>
</html>

2 Answers 2

3

Your id should be

<a href="#" id="clickme">Click me</a>

There was a # in your id.

** EDIT **
Your other problem is that you can't load a page on another domain into your site. You'll have to use an iframe for that.

Sign up to request clarification or add additional context in comments.

1 Comment

still its not loading. I am using IE8 :(
1

Try removing the hash sign from the id of clickme

<a href="#" id="clickme">Click me</a>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.