i have a problem using loadurl()
if i use pjax.loadUrl("/your-url"); i have a error typeError: options is undefined on line 154:5 pjax.js
this my script
(function ($) {
'use strict';
var pjax = new Pjax({
elements: [".ajax-nav a"],
cacheBust : false,
history : true,
currentUrlFullReload : false,
selectors: ["header,title,.app,.ajax-footer,.ajax-nav"]
})
window.activenav = function ()
{
$(".ajax-nav a").each(function () {
if (this.href == window.location.href) {
$(this).addClass("active");
$(this).parent().addClass("active"); // add active to li of the current link
$(this).parent().parent().prev().addClass("active"); // add active class to an anchor
$(this).parent().parent().prev().click(); // click the item to make it drop
}
});
}
function callFunctionApp() {
var options = {
beforeSubmit: showRequest, // pre-submit callback
success: showResponse, // post-submit callback
dataType: 'json', // 'xml', 'script', or 'json' (expected server response type)
//clearForm: true, // clear all form fields after successful submit
//resetForm: true // reset the form after successful submit
};
function showRequest() {
$('body').loading({
message: 'PROSES...'
});
}
function showResponse(response) {
$('body').loading('stop');
if (response.status === 'error'){
var icon = 'ti-close';
var title = '<strong>Oops!</strong>';
} else {
var icon = 'ti-check';
var title = '<strong>Well done!</strong>';
}
$.notify({
title: title,
icon: icon,
message: response.message,
},{
type: response.type,
allow_dismiss: false,
showProgressbar:true,
placement: {
from: "top",
align: "right"
},
offset: {
x : 20,
y : 90
},
timer: 100,
animate: {
enter: 'animated fadeInRight',
exit: 'animated fadeOutRight'
}
});
pjax.loadUrl(response.url);
}
$('form').on('submit', function(e) {
e.preventDefault(); // prevent native submit
$(this).ajaxSubmit(options);
});
activenav();
}
callFunctionApp()
document.addEventListener('pjax:complete', callFunctionApp)
})(jQuery);
if i comment //options.requestOptions.timeout = this.options.timeout inline 154 page is load but url not change.
how to fix this.
Thanks.
i have a problem using loadurl()
if i use `pjax.loadUrl("/your-url");` i have a error `typeError: options is undefined on line 154:5 pjax.js`
this my script
```
(function ($) {
'use strict';
var pjax = new Pjax({
elements: [".ajax-nav a"],
cacheBust : false,
history : true,
currentUrlFullReload : false,
selectors: ["header,title,.app,.ajax-footer,.ajax-nav"]
})
window.activenav = function ()
{
$(".ajax-nav a").each(function () {
if (this.href == window.location.href) {
$(this).addClass("active");
$(this).parent().addClass("active"); // add active to li of the current link
$(this).parent().parent().prev().addClass("active"); // add active class to an anchor
$(this).parent().parent().prev().click(); // click the item to make it drop
}
});
}
function callFunctionApp() {
var options = {
beforeSubmit: showRequest, // pre-submit callback
success: showResponse, // post-submit callback
dataType: 'json', // 'xml', 'script', or 'json' (expected server response type)
//clearForm: true, // clear all form fields after successful submit
//resetForm: true // reset the form after successful submit
};
function showRequest() {
$('body').loading({
message: 'PROSES...'
});
}
function showResponse(response) {
$('body').loading('stop');
if (response.status === 'error'){
var icon = 'ti-close';
var title = '<strong>Oops!</strong>';
} else {
var icon = 'ti-check';
var title = '<strong>Well done!</strong>';
}
$.notify({
title: title,
icon: icon,
message: response.message,
},{
type: response.type,
allow_dismiss: false,
showProgressbar:true,
placement: {
from: "top",
align: "right"
},
offset: {
x : 20,
y : 90
},
timer: 100,
animate: {
enter: 'animated fadeInRight',
exit: 'animated fadeOutRight'
}
});
pjax.loadUrl(response.url);
}
$('form').on('submit', function(e) {
e.preventDefault(); // prevent native submit
$(this).ajaxSubmit(options);
});
activenav();
}
callFunctionApp()
document.addEventListener('pjax:complete', callFunctionApp)
})(jQuery);
```
if i comment `//options.requestOptions.timeout = this.options.timeout` inline 154 page is load but url not change.
how to fix this.
Thanks.
this problem solved thanks for your support
i follow instruction in #127 and npm run build
is this can support submit/upload image enctype="multipart/form-data"?
Thanks you.
Hallo,
this problem solved thanks for your support
i follow instruction in #127 and `npm run build`
is this can support submit/upload image `enctype="multipart/form-data"`?
Thanks you.
this problem solved thanks for your support
i follow instruction in #127 and npm run build
Great. We hope to release v0.2.6 soon, which will include this fix.
is this can support submit/upload image enctype="multipart/form-data"?
Right now, no, but it's the next thing on my to do list. See #132.
>this problem solved thanks for your support
i follow instruction in #127 and npm run build
Great. We hope to release v0.2.6 soon, which will include this fix.
>is this can support submit/upload image enctype="multipart/form-data"?
Right now, no, but it's the next thing on my to do list. See #132.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
i have a problem using loadurl()
if i use
pjax.loadUrl("/your-url");i have a errortypeError: options is undefined on line 154:5 pjax.jsthis my script
if i comment
//options.requestOptions.timeout = this.options.timeoutinline 154 page is load but url not change.how to fix this.
Thanks.
This is a duplicate of #127.
This has been fixed and will be released with v0.2.6. Until then, you can use the workaround mentioned in #127.
Regarding the URL not changing, does the new page load?
yes new page is load, only url not change.
Can you try with the latest version from Github? Clone the repo, and run
npm run build.Hallo,
this problem solved thanks for your support
i follow instruction in #127 and
npm run buildis this can support submit/upload image
enctype="multipart/form-data"?Thanks you.
Great. We hope to release v0.2.6 soon, which will include this fix.
Right now, no, but it's the next thing on my to do list. See #132.