1

I need to create an onload event where an AJAX function is called and passed a value. I can't put it on body because I have both my header and footer cut in sections via PHP. Apparently I can't put this on a div and

    $(#midContainer).ready(function(){
        Change('value1');
    });

This doesnt seem to work and I am not sure why. I got an
"Uncaught SyntaxError: Unexpected token ILLEGAL"

1
  • 1
    You are missing quotes around the element ID Commented Jul 27, 2011 at 19:11

2 Answers 2

3

Replace:

$(#midContainer).ready(function(){
    Change('value1');
});

with

$("#midContainer").ready(function(){
    Change('value1');
});

You are missing quotes around your DIV's Id

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

Comments

1

What is wrong with document.ready ?

$(function(){
   Change('value1');
})

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.