天天看點

初始化 頁面 調用ajax,在使用ajax分頁加載頁面後重新初始化其他javascript函數

道歉,這裡有一個新的.如何加載其他插件,并在加載ajax生成的頁面後讓其他單獨的腳本運作?這是我的代碼:

jQuery(document).ready(function($) {

var $mainContent = $("load-content"),siteUrl = "http://" + top.location.host.toString(),url = '';

$(document).delegate("a[href^='"+siteUrl+"']:not([href*='/wp-admin/']):not([href*='/wp-login.PHP']):not([href$='/Feed/'])","click",function() {

if($.browser.msie){

var myie="/"+this.pathname;

location.hash = myie;

//alert(location.hash);

}else{

location.hash = this.pathname;

}

return false;

});

$("#searchform").submit(function(e) {

$search = $("#s").val();

$search = $.trim($search);

$search = $search.replace(/\s+/g,'+');

location.hash = '?s='+$search;

e.preventDefault();

});

$(window).bind('hashchange',function(){

url = window.location.hash.substring(1);

if (!url) {

return;

}

url = url + " #content";

$('html,body,document').animate({scrollTop:0},'fast');

$mainContent.fadeOut(500,function(){$('#content').fadeOut(500,function(){

$("#loader").show();});}).load(url,function() {

$mainContent.fadeIn(500,function(){

$("#loader").hide(function(){ $('#content').fadeIn(500);});});});

});

$(window).trigger('hashchange');

});

頁面上的嵌入對象如何保留其功能?主要是視訊,幻燈片和其他使用javascript的媒體

VIMEO