标签: page-refresh

html超链接<a>没有刷新

a标签用于Jquery下拉菜单,通常用于ajax.但它改变了页面的问题.我怎么能强迫它不要刷新?

谢谢,

javascript jquery hyperlink page-refresh

2
推荐指数
2
解决办法
6647
查看次数

页面刷新jquery对话框关闭

我想在单击jquery模式弹出窗口内的按钮关闭jquery模式对话框后刷新aspx页面.我的页面中有更新面板,所以也要考虑它.

asp.net-ajax jquery-ui-dialog partial-page-refresh page-refresh

2
推荐指数
1
解决办法
5921
查看次数

如果连接如何使用javascript刷新页面?

我有一个网页,我希望它每2分钟刷新一次,使用以下代码:

location.reload();
Run Code Online (Sandbox Code Playgroud)

问题是我假设用户已连接; 但如果发生了他/她没有在线连接,页面将失败并给出默认浏览器(没有连接错误页面); 并且除了用户手动之外,页面永远不会刷新

我可以包括ping机制来决定是否刷新天气?

javascript jquery page-refresh

2
推荐指数
1
解决办法
3079
查看次数

jQuery KeyUp导致页面刷新

因此使用带有输入的区域应该添加结果,它可以工作,但之后它也会刷新页面.

var targetX, targetY;
var tagCount = 0;
$(function(){
$('#tag').live('click', function(){
    var iid = $(this).attr('p');
    var img = $('#img-'+iid);
    $(img).wrap('<div id="tag-wrapper"></div>');
    $('#tag-wrapper').css({width: $(img).outerWidth(), height: $(img).outerHeight()});
    $('#tag-wrapper').append('<div id="tag-target"></div><div id="tag-input">Name<input type="text" id="tag-name"><span id="savetag">Save</span> <span id="canceltag">Cancel</span></div>');
    $(img).click(function(e){
        mouseX = e.pageX - $('#tag-wrapper').offset().left;
        mouseY = e.pageY - $('#tag-wrapper').offset().top;

        targetWidth = $('#tag-target').outerWidth();
        targetHeight = $('#tag-target').outerHeight();

        targetX = mouseX - targetWidth/2;
        targetY = mouseY - targetHeight/2;

        inputX = mouseX + targetWidth/2;
        inputY = mouseY + targetHeight/2;

        if($('#tag-target').css('display')=='block'){
            $("#tag-target").animate({left: targetX, top: targetY}, 500);
            $("#tag-input").animate({left: inputX, top: inputY}, …
Run Code Online (Sandbox Code Playgroud)

jquery keyboard-events page-refresh

1
推荐指数
1
解决办法
3344
查看次数

如何在提交按钮上运行php代码而不刷新/重新加载页面

我想在提交按钮单击时执行一些PHP代码而不刷新/重新加载我的页面.可能吗?我也有页面加载的JavaScript功能,这就是为什么我不想刷新我的页面.提前致谢.

<?php
if(isset($_POST["search"]))
{
$show = "SELECT * FROM data";
$rs = mysql_query($show) or die(mysql_error());
 $add_to_textbox = "<input type='button' name='btn' value='add' />";
#****results in Grid****
    echo "<table width='360px' border='1' cellpadding='2'>";
    $rowID=1;
while($row = mysql_fetch_array($rs))
{
    echo "<tr>";
    echo "<td width='130px' id='name.$rowID.'>$row[Name]</td>";
    echo "<td width='230px' id='link.$rowID.'><a href = '$row[Link]'>$row[Link]</a></td>";
    echo "<td width='130px' onclick='Display($rowID);'>$add_to_textbox</td>";
    echo "</tr>";
    $rowID++;
}
    echo "</table>";
#**********************
mysql_free_result($rs);
}
?>

<script type="text/javascript">
function Display(rowID){
    var linkVal = document.getElementById('link'+rowID+'').innerHTML.replace(/<\/?[^>]+(>|$)/g, "\n");
    document.getElementById("name").value = document.getElementById('name'+rowID+'').innerHTML;
    document.getElementById("link").value = linkVal; 
    }
</script>
Run Code Online (Sandbox Code Playgroud)

这是我的代码

javascript php ajax submit page-refresh

1
推荐指数
1
解决办法
2万
查看次数

仅刷新/重新加载网页一次

我搜索过高和低,无法找到任何脚本或说明如何ONLY ONCE在最初加载/查看后自动刷新页面.

我实现了一个javascript代码,声明:如果页面完全加载,立即刷新页面,但只刷新一次.

window.onload = function () {window.location.reload()}
Run Code Online (Sandbox Code Playgroud)

但这给出了一个没有"只有一次"的循环.

我也实现了,meta refresh但它也给了一个循环.

<meta http-equiv="refresh" content= "0;URL=http://www.example.com" />
Run Code Online (Sandbox Code Playgroud)

请告诉我如何首次使用身体onload刷新功能only once,而不是每次刷新php页面时都使用.

我表达你的直接反应.谢谢

html javascript php jquery page-refresh

1
推荐指数
1
解决办法
5万
查看次数

强制页面刷新内页链接

我正在尝试链接到内部页面锚点并强制刷新页面。

但是,这不会强制刷新:

<a href="/#example">example link</a>
Run Code Online (Sandbox Code Playgroud)

链接到同一页面中的锚点并强制刷新的最佳方法是什么?

此外,我希望刷新是 GET 请求,即使该页面最后是使用 POST 请求呈现的。

html javascript anchor reload page-refresh

1
推荐指数
1
解决办法
4267
查看次数

页面不活动 30 秒后自动刷新页面并销毁 php 中的会话,无需任何用户交互?

当用户在页面不活动 30 秒后按下刷新时,此代码可以完美运行,但我需要一些代码来自动销毁 sassion 并在页面不活动 30 秒后刷新页面。

  <?php
    $inactive = 30;
    ini_set('session.gc_maxlifetime', $inactive);
    session_start();

    if (isset($_SESSION['testing']) && time() - $_SESSION['testing'] > $inactive) {
        session_unset();     // unset $_SESSION variable for this page
        session_destroy();   // destroy session data
     echo "<br><br>Sorry, you can't go any further!!!";
     echo "<br>Please log in.";
     echo "<br/><a href='index.php'>Go back to login page</a>";
    }else{
    //Here is some code to do when the session is still active
    }

    $_SESSION['testing'] = time();
    ?>
Run Code Online (Sandbox Code Playgroud)

php session page-refresh

1
推荐指数
1
解决办法
3744
查看次数

使用Angular在3秒后重新加载页面

以下是我们正在开发的页面的控制器.

rp3.controller('c1Ctrl', [
    '$scope',
    'xFactory',
    '$timeout',
    '$route',
    function($scope, xFactory, $interval, $timeout, $route) {

        var layout_url = "json/dashboard/layout/mpu/layout.json";

        xFactory.getJSON(layout_url, function(layout) { // read
            // layout's
            // web
            // service
            $.each(layout, function(i, val) {
                chart.push({
                    "v" : val,
                    "x" : xFactory
                });
                // alert(chart[0]);
                var cType = getChartType(val.chartType);
                // alert(cType);
                drawLayout(parentDIV.name, val.position, val.width,
                        val.height, val.title, val.color, val.bgcolor,
                        buttomCtrl.withCtrl, cType);

                    fillLayoutData(xFactory, val.position, val.url,
                            val.height, cType);
            });
        }, function() {
            console.log("Connection! ");

        });

        $timeout(reloadPage, 3000);

        var reloadPage = function() {
            $route.reload();
        }

    } ]); …
Run Code Online (Sandbox Code Playgroud)

page-refresh angularjs

1
推荐指数
1
解决办法
2557
查看次数

Html/php硬刷新

我正在努力刷新我的页面,因为我随机化了我的数据库的顺序,但是当我通过html按钮刷新页面时它不起作用,直到一段时间过去了.我认为这是由于网络浏览器的缓存.如果我通过f5刷新它也不起作用,但如果我使用shift + f5它可以工作.

<?php
if(isset($_GET["genre"])) {
$db = mysqli_connect("localhost","localhost","","test","3306");
$genre = $_GET["genre"];
$sql = "SELECT tittel, aar, id, genre, plot FROM gruppe3_film WHERE genre LIKE '%$genre%' ORDER BY RAND()";
$resultat = mysqli_query($db, $sql);

$rad = mysqli_fetch_assoc($resultat);
    $tittel = $rad['tittel'];
    $aar = $rad['aar'];
    $id = $rad['id'];
    $plot = $rad['plot'];
    echo "
   <h2>$tittel ($aar)</h2>
   <br><a href='javascript:location.reload();'><img src='../image/DBFilmCover/$id.jpg'></a>
   <h4>$plot</h4>
   <hr><button><a href='javascript:location.reload();'><div class='black'>New Random $genre Movie</div></a></button>";
?>
Run Code Online (Sandbox Code Playgroud)

如你所见,我目前正在使用<a href='javascript:location.reload();'>,但我也尝试过javascript:window.location.href=window.location.href内部href

html php page-refresh

1
推荐指数
1
解决办法
5524
查看次数