pjax

jquery pjax request sending twice

强颜欢笑 提交于 2019-11-29 17:49:08
问题 I have a rails app and I keep getting a weird behavior with pjax requests. When I look into my development logs I could see that two requests are being made. The first request is pjax and the next one is not. As a result the page still reloads. I appreciate if anyone could help me with this. 回答1: The JQuery pjax plugin has a default error handler, that will simply reload the target page. This error handler gets called when the timeout has passed, which pjax sets very low. As a result, if your

PJAX listen to pjax:end event with standard js

烂漫一生 提交于 2019-11-29 12:06:20
So github uses "defunkt's" PJAX module ( https://github.com/defunkt/jquery-pjax#events ), and I'm making a firefox addon that needs to listen to the event pjax:end So far I can do it with jquery like this: $(document).on('pjax:end', function (t) { console.log('pjax:end'); }) however how do I do this with standard javascript functions? document.addEventListener('pjax:end',function(){ console.log('ya'); }, true); does not work. for those who know firefox-addons this code code does not work: gBrowser.contentWindow.wrappedJSObject['$'](gBrowser.contentDocument).on('pjax:end', function (t) { Cu

Yii2 Pjax not working

℡╲_俬逩灬. 提交于 2019-11-29 01:39:05
问题 I want to refresh the gridview using Pjax but somehow it is not working. Here is the code: _search.php <?php use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\widgets\Pjax; $this->registerJs(" $('#btnAjaxSearch').click(function(){ $.ajax({ type: 'get', data: $('.bank-search form').serializeArray(), success: function (data) { $.pjax.reload({container:\"#bank\"}); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert('error'); } }); return false; }); ", \yii\web\View::POS

Desperately need a solution for Adsense that works with Ajax

Deadly 提交于 2019-11-28 22:58:49
I know this questions has been asked a few times here. But these seem fairly outdated, and it looks like the Adsense for Ajax project has been canned (or at the very least, moving very slowly). I have a web site that I've recently integrated pjax into -- basically, it uses Ajax to load the just the main content area, while maintaining the browser history and back/forward functionality using javascript's history.pushState .It has made a world of difference in how responsive the whole site is, as it no longer has to do HTTP requests for all of the outer shell of the site (javascript, css, images

Yii2: Updating Grid-view using Pjax

痞子三分冷 提交于 2019-11-28 10:33:12
Following this Wiki Yii 2.0: Pjax on ActiveForm and GridView - Yii2 I have tried to use my gridview to update on Ajax without page-reload, but couldn't succeed. code of my _form.php <?php $this->registerJs( '$("document").ready(function(){ $("#new_medicine").on("pjax:end", function() { $.pjax.reload({container:"#medicine"}); //Reload GridView }); });' ); ?> <?php use yii\helpers\Html; use yii\widgets\ActiveForm; use kartik\grid\GridView; //use yii\grid\Gridview; use yii\data\ActiveDataProvider; /* @var $this yii\web\View */ /* @var $model app\models\Medicine */ /* @var $form yii\widgets

PJAX listen to pjax:end event with standard js

前提是你 提交于 2019-11-28 05:41:53
问题 So github uses "defunkt's" PJAX module (https://github.com/defunkt/jquery-pjax#events), and I'm making a firefox addon that needs to listen to the event pjax:end So far I can do it with jquery like this: $(document).on('pjax:end', function (t) { console.log('pjax:end'); }) however how do I do this with standard javascript functions? document.addEventListener('pjax:end',function(){ console.log('ya'); }, true); does not work. for those who know firefox-addons this code code does not work: