Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Im using this tutorial http://digwp.com/2009/07/display-a-random-post-with-ajax-refresh/# to create a section on my homepage where I can refresh a section with ajax. I have it all setup but the post is not loading on page load. I found a line in the page source that says...

<script type="text/javascript">var ajaxurl = "http://mysite.com/wp-load.php";   </script>

The </script> isn't highlighted like the beginning <script> so I'm wondering if that's the problem. Any idea why that is?

share|improve this question
2  
You should be localizing that and using admin-ajax.php anyways. Read this article for correct implementation. –  m0r7if3r Feb 7 '12 at 2:04
    
Hmmm ok that tutorial went over my head. What changes should I apply to the tutorial above to make it work properly? –  Pollux Khafra Feb 7 '12 at 2:35
    
@m0r7if3r you should post that as an answer. –  Chip Bennett Feb 16 '12 at 3:48
    
I felt like it was a bit skimpy to be considered an answer...but done. –  m0r7if3r Feb 16 '12 at 10:32

1 Answer 1

You should be localizing that and using admin-ajax.php anyways. Read this article for correct implementation.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.