From 9bbf3557fc7491848814688f63bc5b45d8d24ce0 Mon Sep 17 00:00:00 2001 From: bscheshirwork Date: Thu, 26 Jul 2018 12:28:00 +0300 Subject: [PATCH] option.fragment is equal to options.container if not set; also search it in partial content --- jquery.pjax.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jquery.pjax.js b/jquery.pjax.js index d57269d4..112a66ea 100644 --- a/jquery.pjax.js +++ b/jquery.pjax.js @@ -192,6 +192,8 @@ function pjax(options) { options.data._pjax = options.container } + if (!options.fragment) options.fragment = options.container + function fire(type, args, props) { if (!props) props = {} props.relatedTarget = options.target @@ -700,7 +702,9 @@ function extractContainer(data, xhr, options) { obj.title = $fragment.attr('title') || $fragment.data('title') } - } else if (!fullDocument) { + } + + if (!fullDocument && !obj.contents) { obj.contents = $body }