pjax is a jQuery plugin that uses ajax and pushState to deliver a fast browsing experience with real permalinks, page titles, and a working back button.

Overview

pjax = pushState + ajax

pjax is a jQuery plugin that uses ajax and pushState to deliver a fast browsing experience with real permalinks, page titles, and a working back button.

pjax works by fetching HTML from your server via ajax and replacing the content of a container element on your page with the loaded HTML. It then updates the current URL in the browser using pushState. This results in faster page navigation for two reasons:

  • No page resources (JS, CSS) get re-executed or re-applied;
  • If the server is configured for pjax, it can render only partial page contents and thus avoid the potentially costly full layout render.

Status of this project

jquery-pjax is largely unmaintained at this point. It might continue to receive important bug fixes, but its feature set is frozen and it's unlikely that it will get new features or enhancements.

Installation

pjax depends on jQuery 1.8 or higher.

npm

$ npm install jquery-pjax

standalone script

Download and include jquery.pjax.js in your web page:

curl -LO https://raw.github.com/defunkt/jquery-pjax/master/jquery.pjax.js

Usage

$.fn.pjax

The simplest and most common use of pjax looks like this:

$(document).pjax('a', '#pjax-container')

This will enable pjax on all links on the page and designate the container as #pjax-container.

If you are migrating an existing site, you probably don't want to enable pjax everywhere just yet. Instead of using a global selector like a, try annotating pjaxable links with data-pjax, then use 'a[data-pjax]' as your selector. Or, try this selector that matches any links inside a

container:

$(document).pjax('[data-pjax] a, a[data-pjax]', '#pjax-container')

Server-side configuration

Ideally, your server should detect pjax requests by looking at the special X-PJAX HTTP header, and render only the HTML meant to replace the contents of the container element (#pjax-container in our example) without the rest of the page layout. Here is an example of how this might be done in Ruby on Rails:

def index
  if request.headers['X-PJAX']
    render :layout => false
  end
end

If you'd like a more automatic solution than pjax for Rails check out Turbolinks.

Check if there is a pjax plugin for your favorite server framework.

Also check out RailsCasts #294: Playing with PJAX.

Arguments

The synopsis for the $.fn.pjax function is:

$(document).pjax(selector, [container], options)
  1. selector is a string to be used for click event delegation.
  2. container is a string selector that uniquely identifies the pjax container.
  3. options is an object with keys described below.
pjax options
key default description
timeout 650 ajax timeout in milliseconds after which a full refresh is forced
push true use pushState to add a browser history entry upon navigation
replace false replace URL without adding browser history entry
maxCacheLength 20 maximum cache size for previous container contents
version a string or function returning the current pjax version
scrollTo 0 vertical position to scroll to after navigation. To avoid changing scroll position, pass false.
type "GET" see $.ajax
dataType "html" see $.ajax
container CSS selector for the element where content should be replaced
url link.href a string or function that returns the URL for the ajax request
target link eventually the relatedTarget value for pjax events
fragment CSS selector for the fragment to extract from ajax response

You can change the defaults globally by writing to the $.pjax.defaults object:

$.pjax.defaults.timeout = 1200

$.pjax.click

This is a lower level function used by $.fn.pjax itself. It allows you to get a little more control over the pjax event handling.

This example uses the current click context to set an ancestor element as the container:

if ($.support.pjax) {
  $(document).on('click', 'a[data-pjax]', function(event) {
    var container = $(this).closest('[data-pjax-container]')
    var containerSelector = '#' + container.id
    $.pjax.click(event, {container: containerSelector})
  })
}

NOTE Use the explicit $.support.pjax guard. We aren't using $.fn.pjax so we should avoid binding this event handler unless the browser is actually going to use pjax.

$.pjax.submit

Submits a form via pjax.

$(document).on('submit', 'form[data-pjax]', function(event) {
  $.pjax.submit(event, '#pjax-container')
})

$.pjax.reload

Initiates a request for the current URL to the server using pjax mechanism and replaces the container with the response. Does not add a browser history entry.

$.pjax.reload('#pjax-container', options)

$.pjax

Manual pjax invocation. Used mainly when you want to start a pjax request in a handler that didn't originate from a click. If you can get access to a click event, consider $.pjax.click(event) instead.

function applyFilters() {
  var url = urlForFilters()
  $.pjax({url: url, container: '#pjax-container'})
}

Events

All pjax events except pjax:click & pjax:clicked are fired from the pjax container element.

event cancel arguments notes
event lifecycle upon following a pjaxed link
pjax:click ✔︎ options fires from a link that got activated; cancel to prevent pjax
pjax:beforeSend ✔︎ xhr, options can set XHR headers
pjax:start xhr, options
pjax:send xhr, options
pjax:clicked options fires after pjax has started from a link that got clicked
pjax:beforeReplace contents, options before replacing HTML with content loaded from the server
pjax:success data, status, xhr, options after replacing HTML content loaded from the server
pjax:timeout ✔︎ xhr, options fires after options.timeout; will hard refresh unless canceled
pjax:error ✔︎ xhr, textStatus, error, options on ajax error; will hard refresh unless canceled
pjax:complete xhr, textStatus, options always fires after ajax, regardless of result
pjax:end xhr, options
event lifecycle on browser Back/Forward navigation
pjax:popstate event direction property: "back"/"forward"
pjax:start null, options before replacing content
pjax:beforeReplace contents, options right before replacing HTML with content from cache
pjax:end null, options after replacing content

pjax:send & pjax:complete are a good pair of events to use if you are implementing a loading indicator. They'll only be triggered if an actual XHR request is made, not if the content is loaded from cache:

$(document).on('pjax:send', function() {
  $('#loading').show()
})
$(document).on('pjax:complete', function() {
  $('#loading').hide()
})

An example of canceling a pjax:timeout event would be to disable the fallback timeout behavior if a spinner is being shown:

$(document).on('pjax:timeout', function(event) {
  // Prevent default timeout redirection behavior
  event.preventDefault()
})

Advanced configuration

Reinitializing plugins/widget on new page content

The whole point of pjax is that it fetches and inserts new content without refreshing the page. However, other jQuery plugins or libraries that are set to react on page loaded event (such as DOMContentLoaded) will not pick up on these changes. Therefore, it's usually a good idea to configure these plugins to reinitialize in the scope of the updated page content. This can be done like so:

$(document).on('ready pjax:end', function(event) {
  $(event.target).initializeMyPlugin()
})

This will make $.fn.initializeMyPlugin() be called at the document level on normal page load, and on the container level after any pjax navigation (either after clicking on a link or going Back in the browser).

Response types that force a reload

By default, pjax will force a full reload of the page if it receives one of the following responses from the server:

  • Page content that includes when fragment selector wasn't explicitly configured. Pjax presumes that the server's response hasn't been properly configured for pjax. If fragment pjax option is given, pjax will extract the content based on that selector.

  • Page content that is blank. Pjax assumes that the server is unable to deliver proper pjax contents.

  • HTTP response code that is 4xx or 5xx, indicating some server error.

Affecting the browser URL

If the server needs to affect the URL which will appear in the browser URL after pjax navigation (like HTTP redirects work for normal requests), it can set the X-PJAX-URL header:

def index
  request.headers['X-PJAX-URL'] = "http://example.com/hello"
end

Layout Reloading

Layouts can be forced to do a hard reload when assets or html changes.

First set the initial layout version in your header with a custom meta tag.

">
<meta http-equiv="x-pjax-version" content="v123">

Then from the server side, set the X-PJAX-Version header to the same.

if request.headers['X-PJAX']
  response.headers['X-PJAX-Version'] = "v123"
end

Deploying a deploy, bumping the version constant to force clients to do a full reload the next request getting the new layout and assets.

Comments
  • Load js function on load

    Load js function on load

    I use pjax, and everything works, but 1 thing. When i load content, and js with it, js on load works, but function like this:

    var map = {
        init : function() {
            alert('test');
        }
    
    }
    
    map.init
    

    that function is not calling, and ther regular function test() { ... } doesn't work too, why ?

    opened by mirzadelic 24
  • Ignore first go back requeast.

    Ignore first go back requeast.

    lets say u have a search form ,so u enter what u want to search for and the plugin kickin > fetches data ,no prob at all.

    now search once more and try to go back ,the first request will be ignored but will work from the second try.

    i dont know if this is a bug or is it just related to my app.

    unconfirmed 
    opened by ctf0 19
  • Allow PJAX to be used on form submission

    Allow PJAX to be used on form submission

    Not as complicated a commit as it looks. Does a couple things

    1. Allows you to bind to the submit event on a form, treats it very similarly to the click event on a link.
    2. Splits the success callback into two methods, the page replacing part + the state changing part so it:
    3. Deals gracefully with 422 status codes, which aren't errors, but require the page to be changed.

    Also there's a very minor change, which is to wrap the result from the server in a <div> before trying to extract the fragment, in case all the server returns is the fragment.

    Let me know if there's anything I can do to simplify it.

    opened by tmeasday 17
  • Replacing history caching logic

    Replacing history caching logic

    Related to #201 ATTN: @josh Replacing caching Logic...Test this code before merging! I don't yet have a full test suite for pjax up and running. I tried to minimize code changes. For the most part this has resulted in a code reduction.

    opened by davydotcom 15
  • iOS 10

    iOS 10

    Someone with iOS10 already might want to test in Safari.

    We've had to remove pjax completely, seems pjax:complete is never called.

    Will continue to debug and update if I can.

    opened by robmcvey 14
  • My very simple test doesn't work...

    My very simple test doesn't work...

    Hi!

    I must be missing something obvious here but I don't get why this doesn't work...

    <nav id="nav"><a href="testA.html">test A</a> | <a href="testB.html">test B</a></nav>
    <div id="ct">TEST A</div>
    

    and

    $(document).ready(function(){
        $('#ct').pjax('#nav a',{'fragment':'#ct'});
    });
    

    Thanks!

    opened by Kelbonpseudo 14
  • pjax broken?

    pjax broken?

    So initially I tried doing this thing with WordPress, with no dice. In response, I tried doing it with basic HTML & JS.

    Still no dice.

    index is the main page, has one anchor that links to third.html (which is just plain text).

    As you can see below, I am putting a timestamp within the h1 so that I can verify that the pjaxy goodness works.

    However, I can't get it to work.

    I've also tried another file, second.html, that had full html / head tags and the text within a paragraph tag (I used the fragment method - also with no luck).

    Doesn't work in Safari / Chrome / Firefox.

    Would appreciate any help that can be given!

    Thanks so much!

    index.html ::

    <!doctype html>
    <html>
    <head>
      <title>Testing PJAX</title>
      <meta charset="utf-8">
      <link rel="stylesheet" href="">
      <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
      <script type="text/javascript" src="pjax.js"></script>
    
        <script>
            var time = new Date().getTime();
    
            $(document).ready(function(){
    
                $('.time').html(time);
    
                $("a.pjax").pjax("#main" });
    
            });
        </script>
    </head>
    <body>
    
        <h1>TIME: <span class='time'></span></h1>
    
        <a class="pjax" href="third.html">PJAX</a>
    
        <div id="main">
            <h1>This is me testing PJAX!!!</h1>
    
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
            tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
            quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
            consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
            cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
            proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    
        </div>
    
    </body>
    </html>
    

    third.html Bacon ipsum dolor sit amet strip steak short ribs jowl pork loin tri-tip, meatball bacon andouille. Biltong swine spare ribs, pork chop turducken pancetta ball tip brisket turkey tenderloin. Chicken corned beef bresaola drumstick boudin pancetta. Pastrami short loin ball tip venison turducken. Flank shankle ham hock ribeye bacon sausage jowl meatloaf turkey tail fatback. Jerky meatloaf venison cow tri-tip, shoulder bacon hamburger ham pork chop.

    opened by thewatts 14
  • requests aborted

    requests aborted

    I am often getting requests aborted in Firefox and Google Chrome. I tried to debug this and found this piece of code

        if ( xhr && xhr.readyState < 4) {
            xhr.onreadystatechange = $.noop
            xhr.abort()
        }
    

    which makes perfectly sense but the requested aborted problem occurs also if there isn't another request pending. I verified this with this code

        if ( xhr && xhr.readyState < 4) {
            alert('already pjaxing...');
        }
    

    The popup isn't shown but the request often gets aborted. Server side everything works fine. Any idea about this behaviour?

    opened by slampis 14
  • Maintenance status / the future of jquery-pjax

    Maintenance status / the future of jquery-pjax

    jquery-pjax seems unmaintained for a while now. I guess it would be cool if one of the (recent) maintainers (@mislav?) good give an update on the situation.

    I recently did a hack so it can run with jQuery 3.x: https://github.com/defunkt/jquery-pjax/issues/634#issuecomment-230832497

    I might do a (proper) fork, but doubting if I'm the right guy to maintain it (+ willing to).

    opened by oh-ren 13
  • a very ambitious bug: different pjax container with backward

    a very ambitious bug: different pjax container with backward

    Hello, I'm encounting a very strange bug, here I describe it in detail.

    I have a page contain tabs, I want use pjax to make it to update tab block only. so I have 2 level of pjax.

    <div id="block">
        title, desc...
        <div id="tabs">
            <a href="/products/xxx/" data-pjax="#tab">main</a>
            <a href="/products/xxx/feature" data-pjax="#tab">feature</a>
            <a href="/products/xxx/discussion" data-pjax="#tab">discussion</a>
        </div>
        <div id="tab">
            tab detail
        </div>
    </div>
    

    on the server side, it will check pjax-container, and render the part accordinary.

    and here is the issue.

    • first, I click other pjax link, #block will get updated,
    • and click tab, #tab will get updated,
    • and backward, oops, #block is updated (should be #tab),

    So I check the pjax js source code, found the mechanism is different then I think.

    What I think it should be:

    • after a pjax request, pjax will cache this request result with the state. next pjax will push this state.
    • after backward, pop and replay cache.

    actually it is:

    • before a pjax request, cache current request.
    • after backward, pop and replay cache.

    and the issue then like this:

    • /products, #block
    • /products/feature, #tab, save #tab block (wrong)
    • backward, #block + #tab block, error rending.

    the actual web page bug here (you can try it):

    • visit: http://gurudigger.com/incubator
    • click GuruDigger - 帮助靠谱的互联网产品找到志同道合的创业合作工程师
    • click: features
    • backward.

    So how do we fix it?

    opened by halida 13
  • Adding X-PJAX-Container header.

    Adding X-PJAX-Container header.

    I find this useful. It lets the server discern the target container, and as such what 'level' of content that needs rednering into it. Usefull for sub navs and multple containers on a page.

    opened by squeedee 13
  • page reload after append link to hmtl

    page reload after append link to hmtl

    Hi . I want to append [a] link to page with jquery . after append and click on link page reload and pjax not working. what should i fix this problem ?

    opened by arbabi2010 0
  • Bump sinatra from 1.4.5 to 2.2.3

    Bump sinatra from 1.4.5 to 2.2.3

    Bumps sinatra from 1.4.5 to 2.2.3.

    Changelog

    Sourced from sinatra's changelog.

    2.2.3 / 2022-11-25

    • Fix: Escape filename in the Content-Disposition header. #1841 by Kunpei Sakai

    • Fix: fixed ReDoS for Rack::Protection::IPSpoofing. #1823 by @​ooooooo-q

    2.2.2 / 2022-07-23

    • Update mustermann dependency to version 2.

    2.2.1 / 2022-07-15

    • Fix JRuby regression by using ruby2_keywords for delegation. #1750 by Patrik Ragnarsson

    • Add JRuby to CI. #1755 by Karol Bucek

    2.2.0 / 2022-02-15

    • Breaking change: Add #select, #reject and #compact methods to Sinatra::IndifferentHash. If hash keys need to be converted to symbols, call #to_h to get a Hash instance first. #1711 by Olivier Bellone

    • Handle EOFError raised by Rack and return Bad Request 400 status. #1743 by tamazon

    • Minor refactors in base.rb. #1640 by ceclinux

    • Add escaping to the static 404 page. #1645 by Chris Gavin

    • Remove detect_rack_handler method. #1652 by ceclinux

    • Respect content type set in superclass before filter. Fixes #1647 #1649 by Jordan Owens

    • Revert "Use prepend instead of include for helpers. #1662 by namusyaka

    • Fix usage of inherited Sinatra::Base classes keyword arguments. Fixes #1669 #1670 by Cadu Ribeiro

    • Reduce RDoc generation time by not including every README. Fixes #1578 #1671 by Eloy Pérez

    • Add support for per form csrf tokens. Fixes #1616 #1653 by Jordan Owens

    • Update MAINTENANCE.md with the stable branch status. #1681 by Fredrik Rubensson

    • Validate expanded path matches public_dir when serving static files. #1683 by cji-stripe

    • Fix Delegator to pass keyword arguments for Ruby 3.0. #1684 by andrewtblake

    • Fix use with keyword arguments for Ruby 3.0. #1701 by Robin Wallin

    • Fix memory leaks for proc template. Fixes #1704 #1719 by Slevin

    • Remove unnecessary test_files from the gemspec. #1712 by Masataka Pocke Kuwabara

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies ruby 
    opened by dependabot[bot] 0
  • Wrong events lifecycle in case when ajax request is not async

    Wrong events lifecycle in case when ajax request is not async

    When we use container reloading with synchronous ajax request

    $.pjax.reload({container: '#pjax-container', async: false});

    events fire in following order:

    • pjax:beforeSend
    • pjax:beforeReplace
    • pjax:success
    • pjax:complete
    • pjax:end
    • pjax:start
    • pjax:send

    I think it's unexpected behaviour.

    opened by iovzt 0
  • Bump rack from 1.5.2 to 1.6.13

    Bump rack from 1.5.2 to 1.6.13

    Bumps rack from 1.5.2 to 1.6.13.

    Changelog

    Sourced from rack's changelog.

    Changelog

    All notable changes to this project will be documented in this file. For info on how to format all future additions to this file please reference Keep A Changelog.

    [3.0.0] - Unreleased

    Security

    SPEC Changes

    • Response status must now be an integer greater than or equal to 100.
    • Response headers must now be an unfrozen hash.
    • Response header keys can no longer include uppercase characters.
    • Response header values can be an Array to handle multiple values (and no longer supports \n encoded headers).
    • Response body can now respond to #call (streaming body) instead of #each (enumerable body), for the equivalent of response hijacking in previous versions.
    • Middleware must no longer call #each on the body, but they can call #to_ary on the body if it responds to #to_ary.
    • rack.input is no longer required to be rewindable.
    • rack.multithread/rack.multiprocess/rack.run_once are no longer required environment keys.
    • SERVER_PROTOCOL is now a required key, matching the HTTP protocol used in the request.

    Removed

    • Remove rack.multithread/rack.multiprocess/rack.run_once. These variables generally come too late to be useful. (#1720, [@​ioquatix], [@​jeremyevans]))
    • Remove deprecated Rack::Request::SCHEME_WHITELIST. ([@​jeremyevans])
    • Remove internal cookie deletion using pattern matching, there are very few practical cases where it would be useful and browsers handle it correctly without us doing anything special. (#1844, [@​ioquatix])

    Added

    • Rack::Headers added to support lower-case header keys. ([@​jeremyevans])
    • Rack::Utils#set_cookie_header now supports escape_key: false to avoid key escaping. ([@​jeremyevans])
    • Rack::RewindableInput supports size. (@​ahorek)
    • Rack::RewindableInput::Middleware added for making rack.input rewindable. ([@​jeremyevans])
    • The RFC 7239 Forwarded header is now supported and considered by default when looking for information on forwarding, falling back to the X-Forwarded-* headers. Rack::Request.forwarded_priority accessor has been added for configuring the priority of which header to check. (#1423, [@​jeremyevans])
    • Allow response headers to contain array of values. (#1598, [@​ioquatix])

    Changed

    • BREAKING CHANGE: Require status to be an Integer. (#1662, @​olleolleolle)
    • BREAKING CHANGE: Query parsing now treats parameters without = as having the empty string value instead of nil value, to conform to the URL spec. (#1696, [@​jeremyevans])
    • Relax validations around Rack::Request#host and Rack::Request#hostname. (#1606, @​pvande)
    • Removed antiquated handlers: FCGI, LSWS, SCGI, Thin. (#1658, [@​ioquatix])
    • Removed options from Rack::Builder.parse_file and Rack::Builder.load_file. (#1663, [@​ioquatix])
    • Rack::HTTP_VERSION has been removed and the HTTP_VERSION env setting is no longer set in the CGI and Webrick handlers. (#970, [@​jeremyevans])
    • Rack::Request#[] and #[]= now warn even in non-verbose mode. (#1277, [@​jeremyevans])
    • Decrease default allowed parameter recursion level from 100 to 32. (#1640, [@​jeremyevans])
    • Attempting to parse a multipart response with an empty body now raises Rack::Multipart::EmptyContentError. (#1603, [@​jeremyevans])
    • Rack::Utils.secure_compare uses OpenSSL's faster implementation if available. (#1711, @​bdewater)
    • Rack::Request#POST now caches an empty hash if input content type is not parseable. (#749, [@​jeremyevans])

    ... (truncated)

    Commits
    • 47a1fd7 bump version
    • b8dc520 Handle case where session id key is requested but it is missing
    • 698a060 Merge pull request #1462 from jeremyevans/sessionid-to_s
    • de902e4 Merge branch '1-6-sec' into 1-6-stable
    • b7d6546 Bump version
    • d3e2f88 making diff smaller
    • 99a8a87 fix memcache tests on 1.6
    • f2cb48e fix tests on 1.6
    • 7ff635c Introduce a new base class to avoid breaking when upgrading
    • 3232f93 Add a version prefix to the private id to make easier to migrate old values
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies ruby 
    opened by dependabot[bot] 0
  • The css class is missed,when i use PJAX,How to reload it?

    The css class is missed,when i use PJAX,How to reload it?

    Typecho 分页导航 php: <nav aria-label="分页导航区" class="pagination-nav"> <?php $this->pageNav('&laquo;', '&raquo;', 1, '...', array('wrapTag' => 'ul', 'wrapClass' => 'pagination justify-content-center ' . $color['name'], 'itemTag' => 'li', 'textTag' => 'a', 'currentClass' => 'active', 'prevClass' => 'prev', 'nextClass' => 'next')); ?> </nav>

    PJAX OFF: <nav aria-label="分页导航区" class="pagination-nav"> <ul class="pagination justify-content-center dark"><li class="active page-item"><a href="https://ntnas.top:82/typecho/page/1/" class="page-link">1</a></li><li class="page-item"><a href="https://ntnas.top:82/typecho/page/2/" class="page-link">2</a></li><li class="page-item"><a class="page-link">...</a></li><li class="page-item"><a href="https://ntnas.top:82/typecho/page/5/" class="page-link">5</a></li><li class="next page-item"><a href="https://ntnas.top:82/typecho/page/2/" class="page-link" aria-label="下一页">»</a></li></ul> </nav>

    PJAX ON: <nav aria-label="分页导航区" class="pagination-nav"> <ul class="pagination justify-content-center dark"><li class="prev"><a href="https://ntnas.top:82/typecho/page/1/">«</a></li><li><a href="https://ntnas.top:82/typecho/page/1/">1</a></li><li class="active"><a href="https://ntnas.top:82/typecho/page/2/">2</a></li><li><a href="https://ntnas.top:82/typecho/page/3/">3</a></li><li><a>...</a></li><li><a href="https://ntnas.top:82/typecho/page/5/">5</a></li><li class="next"><a href="https://ntnas.top:82/typecho/page/3/">»</a></li></ul> </nav>

    opened by MrTlyer 0
  • Pjax switch fail: DOM doesn't look the same on new page

    Pjax switch fail: DOM doesn't look the same on new page

    Pjax switch fail: DOM doesn't look the same on new page: 'head meta[name='description']' - new 0, old 1 When I clike some pages, I got this error report. I don't know what it means and how could I do. Any help would be appreciated!

    opened by Phantom-Aria 0
Releases(v2.0.1)
  • v2.0.1(May 20, 2017)

    • Fix blurring current active element within pjax container
    • Remove extra & after stripping internal query params
    • Handle documents with no or empty <head> tag
    • Fix npm warnings about package.json
    • Add eslint to project
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(May 19, 2017)

    This release brings jQuery 3.x compatibility.

    Backwards-incompatible changes:

    • The value of container parameter to pjax functions should be a string selector, and not a jQuery object anymore.

    • The value of container parameter cannot be a DOM node with an ID anymore.

    • The call signature $("#main").pjax("a") is not supported anymore because the container selector #main cannot be inferred from the context of the $.fn.pjax() call. To fix this, pass the container selector explicitly: $("#main").pjax("a", "#main")

    Source code(tar.gz)
    Source code(zip)
  • v1.9.6(Apr 2, 2015)

    • Change internal cache struct to fix restoring mixed containers.
    • Avoid tackling on extra # on URLs in Safari.
    • Fix stripping internal query params to avoid touching & and ? in components other than query string.
    Source code(tar.gz)
    Source code(zip)
  • v1.9.5(Mar 7, 2015)

    Pjax content-related fixes:

    • Fix executing inline <script> tags on pjax back/forward
    • Fix popstate with different pjax containers
    • Scroll to named <a name="..."> anchors after pjax navigation
    • Decode hash value before querying for named anchor or element by ID
    • Avoiding calling scrollTop() twice

    Browser URL and anchor fixes:

    • Strip jQuery's cache-busting parameter
    • Keep hash in temporarily changed URL while the page is loading
    • Reflect the hash of the URI in state.url
    • Preserve hash in reloaded URL after pjax request has timed out

    Server request fixes:

    • Abort pending XHR in popstate handler.
    • Handle array form data in pjax fallback behavior
    Source code(tar.gz)
    Source code(zip)
  • v1.9.4(Dec 3, 2014)

    • Avoid Sizzle CSS syntax errors by looking up whether a location.hash references a DOM ID using document.getElementById() instead of passing the whole value as selector to $().
    Source code(tar.gz)
    Source code(zip)
  • v1.9.3(Dec 3, 2014)

    • Fix fragment inclusion when fragment === 'body'
    • Add support for file input fields for form submits
    • Fix maxCacheLength setting and using it to disable caching
    • Don't break the back button after having loaded a static HTML page
    • Fix pjax on iOS Simulator
    • Fix handling <script src> tags with no type attribute
    • Have minifiers retain the copyright notice in source
    • Indicate MIT license in source code
    • Fix adding _pjax parameter when data option is explicitly supplied
    • Simplify & improve detection of same-page anchors
    Source code(tar.gz)
    Source code(zip)
  • v1.9.2(Dec 3, 2014)

    • Ensure pjax.state is consistent before pjax:beforeReplace event
    • Add previous state to beforeReplace event
    • Move state and previousState to be event properties
    • Fix previousState scope to success closure
    Source code(tar.gz)
    Source code(zip)
  • v1.9.1(Dec 3, 2014)

  • v1.9.0(Dec 3, 2014)

  • v1.8.2(Apr 19, 2014)

Owner
Chris Wanstrath
🍔
Chris Wanstrath
Finally, a "back to top" button that behaves like a real elevator.

elevator.js Finally, a "back to top" button that behaves like a real elevator, by adding elevator music to quietly soothe the awkwardness that can ens

Tim Holman 6.6k Dec 27, 2022
An extension for rating the web and making your browsing experience better than ever.

Hookmark An extension for rating the web and making your browsing experience better than ever. Read more about it here Update Firefox extension was un

Haridarshan Choudhary 9 Sep 17, 2022
A Browser extension that not only makes your browsing experience safe but makes it optimized

Sia Sia is a browser extension that not only makes your browsing experience safe but makes it optimized Table of Contents About The Project Built With

Arun Govind M 14 Feb 23, 2022
A chrome extension that inserts dream signs into your browsing experience. Get points when you recognize the dream signs.

There are 3 parts to this repo: Backend Nodejs Frontend React Chrome Extension How to Start frontend and backend $ cd frontend $ npm run start In the

Dashiell Bark-Huss 2 Apr 3, 2022
Enrich your browsing experience, whether it be on mobile (iOS) or your desktop (macOS)

steven's userscripts safari specific AutoScroll.user.js (middle mouse scroll click drag wheel) mobile keyboard.user.js (mobile virtual keyboard shortc

Steven G. 6 Dec 15, 2022
A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.

Strapi Preview Button A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view. Get Started Features I

Matt Milburn 53 Dec 30, 2022
infiniteScrollWithTemplate - JQuery plugin for ajax-enabled infinite page scroll / auto paging with template

jQuery Infinite With Template Plugin JQuery plugin for ajax-enabled infinite page scroll with template. If you like jQuery until now, this little libr

이삼구 2 Mar 19, 2021
Create Bootstrap 5 Modal Box using JavaScript with custom title, description, button labels and custom YES button callback

Dynamic BS5 Modal Box Create Bootstrap 5 Modal Box using JavaScript with custom title, description, button labels and custom YES button callback Insta

null 5 Oct 23, 2022
Jquery-actualizer - jQuery ajax actualizer

jQuery AJAX Actualizer Include jQuery & this plugin into your HTML file and use this js code: $('#target').actualizer('a'); On click at any A element,

Šimon (Simon) Rataj 1 Jul 28, 2020
This is a simple app that keeps track of count. It also has a reset button that takes the count back to zero.

Counter This is a simple app that keeps track of count. It also has a reset button that takes the count back to zero. Built With HTML SCSS CSS Javascr

Abubakar Ummar 5 Oct 17, 2022
A jQuery plugin to submit forms with files via AJAX and to get a response with errors.

jquery-ajaxform A jQuery plugin to submit form with files via AJAX and to get a response with errors. Browsers without FormData uses iframe transport

gozoro 2 Mar 30, 2021
OnePiece /r/place repo to store the template and script for outlining the place to put titles

onepiece-place OnePiece /r/place repo to store the template and script for outlining the place to put titles This script & repo are cloned from Antice

Lopeh 11 Apr 9, 2022
Transpile TypeScript on the fly and deliver it from your server as ES Modules.

ts-serve TypeScript + ES Modules Transpile TypeScript on the fly and serve it from your server as ES Modules. import { serve } from "https://deno.land

ayame113 28 Aug 15, 2022
Open-source CD platform that helps developers to deliver applications efficiently by simplifying software releases and operations in any environment.

dyrector.io - The open source internal delivery platform Overview dyrector.io is an open-source internal delivery platform that helps developers to de

dyrector.io 160 Jan 3, 2023
Browser Extension to deliver AI-generated alt-text for the Visually Impaired.

GenAlt - Generated Image Descriptions for BVI The Blind and Visually Impaired (BVI) rely on alt-text, image descriptions, to experience the trillions

Anish 11 Sep 10, 2022
Master Collection NFT. Mints NFTs on Ethereum containing unique combination of titles for fun.

Master NFT Collection Master NFT Collection is an NFT minting platform that mints NFTs that contain a unique combination of snazzy titles just for fun

MJ LEE 2 Mar 22, 2022
GitHub Action to validate that PR titles in n8n-io/n8n match n8n's version of the Conventional Commits spec

validate-n8n-pull-request-title GitHub Action to validate that PR titles in n8n-io/n8n match n8n's version of the Conventional Commits spec. Setup Cre

Iván Ovejero 2 Oct 7, 2022
Periksa apakah data browsing history anda bocor?

Leak Checker Periksa apakah data browsing history anda bocor? Periksa di leak.riset.tech Webapp ini statis tidak ada informasi yang dikirim ke server,

Robin Syihab 33 Sep 19, 2022