hello Im Rajnikant

On Dec 20, 11:28 am, jefffederman <jefffeder...@gmail.com> wrote:
> Hi,
>
> I'm a relative newcomer to jQuery (and Javascript in general), and I'm
> having a problem with content loaded viaAJAXthat I gather is related
> to event delegation/rebinding.
>
> I'm using jqModal to populate a modal window with html content viaAJAX.  The 
> content contains both text and a Flowplayer instance (open
> source .flv player).  The first time I open the modal window, both the
> text and the Flowplayer movie load properly viaAJAX.  But each
> subsequent time I open the modal window, only the text appears.
>
> Here is the code for the original page (default.php):
>
> <body>
>         <a href="#" class="jqModal">Click here forAJAX!</a>
>         <div id="wrapper">
>                 <div id="ajax" class="jqmWindow">
>                         <a id="player" class="flowplayer"></a>
>                 </div> <!-- end #ajax-->
>         </div>
>
> </body>
>
> Here is the content loaded viaAJAX(ajax.php):
>
> <a href="#" class="jqmClose">Close</a>
> <br />
> <h2 class="centered">AJAXworks!</h2>
> <a id="player">
> </a>
>
> Here is the jQuery script:
>
> var loadFlowplayer = function() {
>         $("#player").flowplayer("/swf/flowplayer-3.0.2.swf", {
>                 clip: {
>                         url: '/video/test.flv',
>                         autoPlay: false
>                 }
>         });
>
> }
>
> $(document).ready(function() {
>
>         $('#ajax').jqm({ajax: '/ajax.php', onLoad: loadFlowplayer};
>
> });
>
> After reading through the jQuery board for similar topics, I tried
> removing the Flowplayer portion of the jQuery script (and deleting the
> jqModal onLoad callback) and appending it directly toajax.php, like
> so:
>
> <a href="#" class="jqmClose">Close</a>
> <br />
> <h2 class="centered">AJAXworks!</h2>
> <a id="player"></a>
>
> <script type="text/javascript" charset="utf-8">
>
>         $('#player').flowplayer('/swf/flowplayer-3.0.2.swf', {
>                 clip: {
>                         url: '/video/test.flv',
>                         autoPlay: false
>                 }
>         });
>
> </script>
>
> The result was the same -- both movie player and text load fine after
> the firstAJAXcall, each subsequent time only the text loads.
>
> I thought that by either calling flowplayer() as a callback to theAJAXrequest 
> in the external script or by including it inline in
> script tags with the remote content that I was rebinding the event to
> the jQuery selector, but it seems I'm mistaken.
>
> Any help would be much appreciated.
>
> Cheers,
> Jeff

Reply via email to