我有一個click事件這個jQuery電話:如何通過jQuery傳遞post變量?
var url = "http://www.....";
$('#platforms-lasers-video').load(url + ' #platforms-lasers', {video: 'platforms-lasers'});
我使用笨,並通過$數據[「視頻」] = $這個 - >輸入 - >後(「視頻」)的觀點,確保將$數據傳遞給視圖。
我贊同這樣的:
<div id="<?php echo $video; ?>">
<div id="video">
<video width="650" height="360" controls="controls" preload="auto" poster="<?php echo base_url(); ?>images/features/<?php echo $video; ?>.jpg">
<source src="<?php echo base_url(); ?>videos/<?php echo $video; ?>.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="<?php echo base_url(); ?>videos/<?php echo $video; ?>.webm" type='video/webm; codecs="vp8, vorbis"' />
<source src="<?php echo base_url(); ?>videos/<?php echo $video; ?>.ogv" type='video/ogg; codecs="theora, vorbis"' />
<object id="flash_fallback_1" class="vjs-flash-fallback" width="650" height="360" type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf" />
<param name="allowfullscreen" value="true" />
<param name="flashvars" value='config={"playlist":["<?php echo base_url(); ?>images/<?php echo $video; ?>.jpg", {"url": "<?php echo base_url(); ?>videos/<?php echo $video; ?>.mp4","autoPlay":false,"autoBuffering":true}]}' />
<img src="<?php echo base_url(); ?>images/<?php echo $video; ?>.jpg" width="650" height="360" alt="" title="<?php echo $v->no_playback; ?>" />
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="<?php //echo $v->get_flash; ?>" />
</a>
</object>
</video>
</div>
</div>
但後變量沒有被傳遞給視圖。我怎麼做?
'但後置變量沒有被傳遞給視圖'。你是什麼意思? –
您是否嘗試過:'$('#platforms-lasers-video')。load(url,{video:'platforms-lasers'})'?我認爲'#'沒用。 – Galled
嘗試將'video''而不是'video'並嘗試使用'$ data ['video'] = $ this-> input-> get('video');'。也許你的問題出現了jquery加載方法。 –