Trying to pass the input value in the query string but failing why?

Posted by Ahmad Fouad on Stack Overflow See other posts from Stack Overflow or by Ahmad Fouad
Published on 2011-01-07T03:26:17Z Indexed on 2011/01/07 3:54 UTC
Read the original article Hit count: 242

Filed under:

Hello,

I have this code in the page.

<input type="text" value="Enter your video URL here..." size="30" class="video_url" />

<input type="button" value="Preview" class="preview_button" />

<div id="preview"></div>

<script type="text/javascript">
(function($) {

    $(".preview_button").click(function(){

        var url = $('.video_url').val();

        $("#preview").load('<?php bloginfo('template_directory'); ?>/templates/preview.php?url=' + url);

    });

}) (jQuery);
</script>

However on preview.php I can never see the url value. What I am doing wrong?

© Stack Overflow or respective owner

Related posts about jQuery