Skip to content
Advertisement

javascript function didn’t refresh my php code

I want to refresh my div with PHP code in div tag but it’s don’t work. console said:

Uncaught TypeError: $(…).load is not a function

at doRefresh

JavaScript

EDIT

OP has updated code based on answer and comments.

Advertisement

Answer

Include your code in a document ready handler to ensure the script will run once the page loads:

JavaScript

In addition, remove one of the jQuery library requests as this may cause problems. You also have an extra </script> tag which should be removed.

You do not need the second document handler, but it should not hurt anything. I have removed iy here.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement