寻找处理页面的脚本 [英] Looking for a script that handles pages

查看:49
本文介绍了寻找处理页面的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我并不知道我怎么说这个,但我会试一试,希望你们明白我在寻找什么。



现在,我正在运行一个面板(CMS)并管理我的所有内容。我有它所以我不必手动更新导航的每个页面。我的代码是:



Hello, I'm not exaclty sure how I can word this, but I'll give it a shot, and hopefully you guys understand what it is that I'm looking for.

Right now, I'm running a panel (CMS) and managing all of my content. I have it so I don't have to manually update each page for the navigation. The code I have is:

$(function(){
  // Link handling.
  $('a[rel != "noAJAX"]').live('click', function(event){
    if ($(this).attr('name') != ""){
        var currentDiv = $(this).attr('name');
    }else{
        var currentDiv = divID;
    }
    $(currentDiv).html(loadingHTML);
    $(currentDiv).load($(this).attr('href'));
    event.preventDefault();
  });
  $('form[rel != "noAJAX"]').live('submit', function(event){
    if ($(this).attr('name') != ""){
        var currentDiv = $(this).attr('name');
    }else{
        var currentDiv = divID;
    }
    $(currentDiv).html(loadingHTML);
    $.post($(this).attr('action'), $(this).serialize(), function(html){
        $(currentDiv).html(html);
    });
    return false;
  });
});







$(function(){
                divID = '#load';
                  loadingHTML = '<center><img style="margin-top:50px; margin-bottom: 50px;" src=""></center>';
                $('#load').load('front');
            });







基本上处理div,和页面如何交互在该页面内提交表单提交等。这段代码已被弃用了。



我要求的问题是,如果有一个地方或脚本你可以推荐我处理与上述类似的东西。类似于




Basically handles the div, and how pages interact with form submissions etc inside that page. This code is pretty much deprecated.

The question I'm asking for, is if there is a place or script you could recommend me that handles something similar to the above. Something like

pushState

带有AJAX的脚本,在div中加载页面,而我不需要每次我想要更改导航等时更新该页面。



希望你们明白我的意思。

script with AJAX that have pages loading in a div, whereas I don't have to update that page everytime I want to make a change to the navigation etc.

Hopefully you guys understand what I mean.

推荐答案

(function(){
// 链接处理。
(function(){ // Link handling.


' a [rel!=noAJAX]') .live(' 点击',功能( event ){
if
('a[rel != "noAJAX"]').live('click', function(event){ if (


this )。attr(' name')!= ){
var currentDiv =
(this).attr('name') != ""){ var currentDiv =


这篇关于寻找处理页面的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆