How to diagnose why added element disappears
jquery-3.1.0
This script adds "blablabla". But after that the page reloads.
So, the added element disappears.
When I stop in the debugger (the brekapoint is in the code), "blablabla" is vaisible, then I make step and occur somewhere in the middle of jQuery. I tried to show you where I occur.
I have removed all irrelevant scripts, but still can't localize the problem.
And of course I can't model it in jsfiddle.
Could you give me a kick here?
<script>
function show_frame_person_create_get(){
$("#people").after("blablabla");
debugger;
}
function init_frame_person_create(){
var person_create_button = $('#person_create');
person_create_button.click(show_frame_person_create_get);
}
init_frame_person_create();
</script>
jQuery.event = {
...
dispatch: function( nativeEvent ) {
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers
ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
handleObj.handler ).apply( matched.elem, args );
if ( ret !== undefined ) { // I OCCUR HERE!
);
javascript jquery
add a comment |
jquery-3.1.0
This script adds "blablabla". But after that the page reloads.
So, the added element disappears.
When I stop in the debugger (the brekapoint is in the code), "blablabla" is vaisible, then I make step and occur somewhere in the middle of jQuery. I tried to show you where I occur.
I have removed all irrelevant scripts, but still can't localize the problem.
And of course I can't model it in jsfiddle.
Could you give me a kick here?
<script>
function show_frame_person_create_get(){
$("#people").after("blablabla");
debugger;
}
function init_frame_person_create(){
var person_create_button = $('#person_create');
person_create_button.click(show_frame_person_create_get);
}
init_frame_person_create();
</script>
jQuery.event = {
...
dispatch: function( nativeEvent ) {
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers
ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
handleObj.handler ).apply( matched.elem, args );
if ( ret !== undefined ) { // I OCCUR HERE!
);
javascript jquery
1
can you provide fiddle
– Nikhil Ghuse
Sep 7 '16 at 13:16
jsfiddle.net/qx839j7k/12 But fiddle can't show anything here.
– Michael
Sep 7 '16 at 13:30
Can you show graphically what is happening and what you want..?
– Nikhil Ghuse
Sep 7 '16 at 13:47
are you asking why your page is reloading? Or are you asking why the element disappears? The element disappears because the page is re-loaded, obviously. But why the page re-loads is not clear from the code you've posted so far
– ADyson
Sep 7 '16 at 13:55
Is $('#person_create') by chance a button? What happens if you add a preventDefault() to show_frame_person_create_get
– JonSG
Sep 17 '16 at 22:09
add a comment |
jquery-3.1.0
This script adds "blablabla". But after that the page reloads.
So, the added element disappears.
When I stop in the debugger (the brekapoint is in the code), "blablabla" is vaisible, then I make step and occur somewhere in the middle of jQuery. I tried to show you where I occur.
I have removed all irrelevant scripts, but still can't localize the problem.
And of course I can't model it in jsfiddle.
Could you give me a kick here?
<script>
function show_frame_person_create_get(){
$("#people").after("blablabla");
debugger;
}
function init_frame_person_create(){
var person_create_button = $('#person_create');
person_create_button.click(show_frame_person_create_get);
}
init_frame_person_create();
</script>
jQuery.event = {
...
dispatch: function( nativeEvent ) {
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers
ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
handleObj.handler ).apply( matched.elem, args );
if ( ret !== undefined ) { // I OCCUR HERE!
);
javascript jquery
jquery-3.1.0
This script adds "blablabla". But after that the page reloads.
So, the added element disappears.
When I stop in the debugger (the brekapoint is in the code), "blablabla" is vaisible, then I make step and occur somewhere in the middle of jQuery. I tried to show you where I occur.
I have removed all irrelevant scripts, but still can't localize the problem.
And of course I can't model it in jsfiddle.
Could you give me a kick here?
<script>
function show_frame_person_create_get(){
$("#people").after("blablabla");
debugger;
}
function init_frame_person_create(){
var person_create_button = $('#person_create');
person_create_button.click(show_frame_person_create_get);
}
init_frame_person_create();
</script>
jQuery.event = {
...
dispatch: function( nativeEvent ) {
// Determine handlers
handlerQueue = jQuery.event.handlers.call( this, event, handlers
ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
handleObj.handler ).apply( matched.elem, args );
if ( ret !== undefined ) { // I OCCUR HERE!
);
javascript jquery
javascript jquery
asked Sep 7 '16 at 13:13
MichaelMichael
1,3021228
1,3021228
1
can you provide fiddle
– Nikhil Ghuse
Sep 7 '16 at 13:16
jsfiddle.net/qx839j7k/12 But fiddle can't show anything here.
– Michael
Sep 7 '16 at 13:30
Can you show graphically what is happening and what you want..?
– Nikhil Ghuse
Sep 7 '16 at 13:47
are you asking why your page is reloading? Or are you asking why the element disappears? The element disappears because the page is re-loaded, obviously. But why the page re-loads is not clear from the code you've posted so far
– ADyson
Sep 7 '16 at 13:55
Is $('#person_create') by chance a button? What happens if you add a preventDefault() to show_frame_person_create_get
– JonSG
Sep 17 '16 at 22:09
add a comment |
1
can you provide fiddle
– Nikhil Ghuse
Sep 7 '16 at 13:16
jsfiddle.net/qx839j7k/12 But fiddle can't show anything here.
– Michael
Sep 7 '16 at 13:30
Can you show graphically what is happening and what you want..?
– Nikhil Ghuse
Sep 7 '16 at 13:47
are you asking why your page is reloading? Or are you asking why the element disappears? The element disappears because the page is re-loaded, obviously. But why the page re-loads is not clear from the code you've posted so far
– ADyson
Sep 7 '16 at 13:55
Is $('#person_create') by chance a button? What happens if you add a preventDefault() to show_frame_person_create_get
– JonSG
Sep 17 '16 at 22:09
1
1
can you provide fiddle
– Nikhil Ghuse
Sep 7 '16 at 13:16
can you provide fiddle
– Nikhil Ghuse
Sep 7 '16 at 13:16
jsfiddle.net/qx839j7k/12 But fiddle can't show anything here.
– Michael
Sep 7 '16 at 13:30
jsfiddle.net/qx839j7k/12 But fiddle can't show anything here.
– Michael
Sep 7 '16 at 13:30
Can you show graphically what is happening and what you want..?
– Nikhil Ghuse
Sep 7 '16 at 13:47
Can you show graphically what is happening and what you want..?
– Nikhil Ghuse
Sep 7 '16 at 13:47
are you asking why your page is reloading? Or are you asking why the element disappears? The element disappears because the page is re-loaded, obviously. But why the page re-loads is not clear from the code you've posted so far
– ADyson
Sep 7 '16 at 13:55
are you asking why your page is reloading? Or are you asking why the element disappears? The element disappears because the page is re-loaded, obviously. But why the page re-loads is not clear from the code you've posted so far
– ADyson
Sep 7 '16 at 13:55
Is $('#person_create') by chance a button? What happens if you add a preventDefault() to show_frame_person_create_get
– JonSG
Sep 17 '16 at 22:09
Is $('#person_create') by chance a button? What happens if you add a preventDefault() to show_frame_person_create_get
– JonSG
Sep 17 '16 at 22:09
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39370898%2fhow-to-diagnose-why-added-element-disappears%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f39370898%2fhow-to-diagnose-why-added-element-disappears%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
can you provide fiddle
– Nikhil Ghuse
Sep 7 '16 at 13:16
jsfiddle.net/qx839j7k/12 But fiddle can't show anything here.
– Michael
Sep 7 '16 at 13:30
Can you show graphically what is happening and what you want..?
– Nikhil Ghuse
Sep 7 '16 at 13:47
are you asking why your page is reloading? Or are you asking why the element disappears? The element disappears because the page is re-loaded, obviously. But why the page re-loads is not clear from the code you've posted so far
– ADyson
Sep 7 '16 at 13:55
Is $('#person_create') by chance a button? What happens if you add a preventDefault() to show_frame_person_create_get
– JonSG
Sep 17 '16 at 22:09