0

Something strange is happening using jquery .load() function.

$('#divR').load('clock01.html'); 

Nothing happens - many times. Or, just a part of the file is loaded, but it is scattered around the screen.

Then I tried inside #divR:

<?php include "clock01.html"?> // always works ok

And then again

$('#divR').load('clock01.html'); //always works, but only after php include

Tested about 10 times, without exception. What could be the reason ?

I regularly cleared the browser cache, each time.

2
  • 1
    Really hard to give a helpful answer without the source code of the javascript and the contents of clock01.html Commented Jul 16, 2013 at 10:44
  • 1
    Make sure .load() is executed when dom is ready. Commented Jul 16, 2013 at 10:50

1 Answer 1

1

There is some possibility's first check your error console using F12 or cntrl+sift+j 1. Have u declared div with same id like 'divR' 2. Do you included jquery lib ?

u put block after html put after a page not after html

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

3 Comments

I checked everything. You can see the whole story on www.zokam.22web.org. Click on Clock and then Next button. Please check.
1.st why u put <script> block after html put after a page not after html
Anant, you solved the problem. I move body and html after </script> and it works. Thanks a lot. Could you place some answer, pls, so I could accept it.

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.