如何在不刷新页面的情况下重新加载数据

时间:2015-08-05 10:40:21

标签: javascript php jquery pagination

我确实有下面的代码,我试图更新数据而不用分页刷新页面。我尝试过很多从stackoverflow中获取但未成功的东西。

PHP -

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.cognifit.cognifitSocialFlex</groupId>
    <artifactId>FlexCognifit</artifactId>
    <packaging>swf</packaging>
    <name>cognifitSocialFlex</name>
    <version>11.0.2.10</version>

    <properties>
        <flex.version>4.14.1.20150325</flex.version>
        <flashplayer.version>11.1</flashplayer.version>
    </properties>

    <build>
        <sourceDirectory>src</sourceDirectory>
        <directory>${project.basedir}/target/${project.version}</directory>
        <plugins>
            <plugin>
                <groupId>net.flexmojos.oss</groupId>
                <artifactId>flexmojos-maven-plugin</artifactId>
                <version>7.0.1</version>
                <extensions>true</extensions>
                <configuration>
                    <sourceFile>CpcSocialFlex.mxml</sourceFile>
                    <swfVersion>13</swfVersion>
                    <targetPlayer>11.1.0</targetPlayer>

                    <localesCompiled>
                        <locale>ar_MA</locale>
                        <locale>de_AT</locale>
                        <locale>de_CH</locale>
                        <locale>de_DE</locale>
                        <locale>el_GR</locale>
                        <locale>en_US</locale>
                        <locale>en_ZA</locale>
                        <locale>es_ES</locale>
                        <locale>es_MX</locale>
                        <locale>fr_FR</locale>
                        <locale>he_IL</locale>
                        <locale>it_IT</locale>
                        <locale>ja_JP</locale>
                        <locale>ko_KR</locale>
                        <locale>nl_NL</locale>
                        <locale>pt_BR</locale>
                        <locale>pt_PT</locale>
                        <locale>ru_RU</locale>
                        <locale>sr_RS</locale>
                        <locale>tr_TR</locale>
                        <locale>zh_CN</locale>
                        <locale>zh_HK</locale>
                    </localesCompiled>

                    <dependencies>
                        <dependency>
                            <groupId>org.apache.flex</groupId>
                            <artifactId>compiler</artifactId>
                            <version>${flex.version}</version>
                            <type>pom</type>
                        </dependency>
                    </dependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apache.flex</groupId>
            <artifactId>framework</artifactId>
            <version>${flex.version}</version>
            <type>pom</type>
        </dependency>

        <dependency>
            <groupId>com.adobe.flash.framework</groupId>
            <artifactId>playerglobal</artifactId>
            <version>${flashplayer.version}</version>
            <type>swc</type>
        </dependency>

        <dependency>
            <groupId>com.adobe.flex.framework.themes</groupId>
            <artifactId>halo</artifactId>
            <type>swc</type>
            <scope>theme</scope>
            <version>${flex.version}</version>
        </dependency>
    </dependencies>
</project>

我确实有下面的分页功能文件:

Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T12:29:23-05:00)
Maven home: /usr/local/maven
Java version: 1.6.0_14, vendor: Sun Microsystems Inc.
Java home: /usr/java/jdk1.6.0_14/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "2.6.21.7-2.fc8xen", arch: "i386", family: "unix"

请帮我整合javascript,以便在不刷新页面的情况下加载数据。

1 个答案:

答案 0 :(得分:1)

您正在寻找的是Ajax。看看这里:http://www.w3schools.com/ajax/ajax_intro.asp 当用户单击下一页时,您可以使用JS捕获该操作,并将所选页面推送到Ajax脚本,然后计算要加载的新数据的偏移量。这是您正在寻找的答案还是您在寻找代码?