Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm hoping this makes sense. When a user clicks on a post title I'm launching a modal overlay via fancybox, and feeding the associated post content via ajax. However I have a javascript call function that I need to run that is from the post that isn't running when the content is pulled. I have a guess the it has something to do with $(document).ready(function() Any ideas? How to I load this function after the modal overlay has been triggered?

<script type="text/javascript">
    ready: function () {
      $(this).jPlayer("setMedia", {
        m4v: "",
        ogv: "",
        poster: ""
    swfPath: "/js",
    supplied: "m4v, ogv",
                        size: {
                     width: "850px",
                     height: "438px"
share|improve this question

1 Answer 1

up vote 1 down vote accepted

You need to apply any javascript after the content is loaded. See the Callbacks tab in documentation.

    afterLoad: function(current, previous){
        // initialize your js stuff  
share|improve this answer

Your Answer


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.