JQuery doesn't work at times and Im not sure whyIs there an “exists” function for jQuery?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Disable/enable an input with jQuery?How can I refresh a page with jQuery?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?

What does it mean by "my days-of-the-week underwear only go to Thursday" in this context?

Which lens has the same capability of lens mounted in Nikon P1000?

Why is 6. Nge2 better, and 7. d5 a necessary push in this game?

GP conform to mesh

speckled vs. spotted

Plotting curves within a foreach loop and attributing colors from a colormap

Seventh degree polynomial

Why does C++ have 'Undefined Behaviour' and other languages like C# or Java don't?

There are 51 natural numbers between 1-100, proof that there are 2 numbers such that the difference between them equals to 5

How to check if my quadrature encoder is broken or not?

What secular civic space would pioneers build for small frontier towns?

My Project Manager does not accept carry-over in Scrum, Is that normal?

Duplicate Tuples in two different ways

Does the app TikTok violate trademark?

A famous scholar sent me an unpublished draft of hers. Then she died. I think her work should be published. What should I do?

Youtube not blocked by iptables

Are fuzzy sets appreciated by OR community?

Iterating over &Vec<T> and Vec<&T>

Convex hull in a discrete space

What should I consider when deciding whether to delay an exam?

Is it acceptable to say that a reviewer's concern is not going to be addressed because then the paper would be too long?

What is the white pattern on trim wheel for?

Is differentiation as a map discontinuous?

What exactly did this mechanic sabotage on the American Airlines 737, and how dangerous was it?



JQuery doesn't work at times and Im not sure why


Is there an “exists” function for jQuery?Add table row in jQueryHow do I check if an element is hidden in jQuery?Setting “checked” for a checkbox with jQuery?How can I know which radio button is selected via jQuery?How to check whether a checkbox is checked in jQuery?Disable/enable an input with jQuery?How can I refresh a page with jQuery?jQuery scroll to element“Thinking in AngularJS” if I have a jQuery background?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I'm still new to JQuery, because I keep having weird issues like this with no error and that make no sense. It's not something I can google, though I have and I'm getting no where. So please tell me what I'm missing. I can make this work on jsfiddle, but fails everywhere else.






$(document).ready(function() 

var intID = null;


$('[delbtn]').click( function()
var msg = $('[delbtn]').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);

$('#DeleteButton').click( function()
var msg = $('#DeleteButton').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);
);

body 
margin: 10px;


input
margin: 20px;
display: block;


#PromptDialog
background-color: #000;
border-radius: 20px;
padding: 10px;


.ui-dialog, .ui-dialog-title
text-align: center;
width: 100%;


.ui-dialog-titlebar-close

display:none;


.ui-dialog .ui-dialog-buttonpane

text-align: center;
background: red;


.ui-widget-header, .ui-state-default
background:#b9cd6d;
border: 1px solid #b9cd6d;
color: #000;
font-weight: bold;


.ui-dialog

background: blue;
color: #fff;


.ui-dialog-content

color: #fff;


.ui-button.yesClass

background: green;
color: #000;


.ui-button.noClass

background: green;
color: #fff;


.ui-button.noClass.ui-state-hover,
.ui-button.noClass.ui-state-active,
.ui-button.yesClass.ui-state-hover,
.ui-button.yesClass.ui-state-active

background: red;
color: yellow;

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="PromptDialog" style="display:none;"></div>
<input type="button" id="DeleteButton" msg="Are you sure you want to delete it?" value="Delete This">
<input type="button" id="DeleteButton2" delbtn="1" msg="Wait, What ??" value="Delete This">
<div id="resposneText"></div>





JSFiddle Link










share|improve this question


























  • where do you have the js? on doc ready? on load? somewhere else?

    – Huangism
    Mar 28 at 18:38











  • It works on jsFiddle because by default they wrap your JavaScript in a window.load handler. If you're not also doing that, or not using document.ready, or not loading your JS at the end of the page, then you're probably running it too early

    – j08691
    Mar 28 at 18:39












  • My actual code has the JavaScript in a different file and is at the bottom of the page.

    – Switch
    Mar 28 at 18:50











  • Have you run your code with the dev tools console open to see if there are errors when it doesn't work properly?

    – j08691
    Mar 28 at 18:52











  • Yes.. Uncaught TypeError: $(...).dialog is not a function at HTMLInputElement.<anonymous> (question.js:8) at HTMLInputElement.dispatch (jquery.min.js:3) at HTMLInputElement.i (jquery.min.js:3)

    – Switch
    Mar 28 at 18:57

















-1















I'm still new to JQuery, because I keep having weird issues like this with no error and that make no sense. It's not something I can google, though I have and I'm getting no where. So please tell me what I'm missing. I can make this work on jsfiddle, but fails everywhere else.






$(document).ready(function() 

var intID = null;


$('[delbtn]').click( function()
var msg = $('[delbtn]').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);

$('#DeleteButton').click( function()
var msg = $('#DeleteButton').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);
);

body 
margin: 10px;


input
margin: 20px;
display: block;


#PromptDialog
background-color: #000;
border-radius: 20px;
padding: 10px;


.ui-dialog, .ui-dialog-title
text-align: center;
width: 100%;


.ui-dialog-titlebar-close

display:none;


.ui-dialog .ui-dialog-buttonpane

text-align: center;
background: red;


.ui-widget-header, .ui-state-default
background:#b9cd6d;
border: 1px solid #b9cd6d;
color: #000;
font-weight: bold;


.ui-dialog

background: blue;
color: #fff;


.ui-dialog-content

color: #fff;


.ui-button.yesClass

background: green;
color: #000;


.ui-button.noClass

background: green;
color: #fff;


.ui-button.noClass.ui-state-hover,
.ui-button.noClass.ui-state-active,
.ui-button.yesClass.ui-state-hover,
.ui-button.yesClass.ui-state-active

background: red;
color: yellow;

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="PromptDialog" style="display:none;"></div>
<input type="button" id="DeleteButton" msg="Are you sure you want to delete it?" value="Delete This">
<input type="button" id="DeleteButton2" delbtn="1" msg="Wait, What ??" value="Delete This">
<div id="resposneText"></div>





JSFiddle Link










share|improve this question


























  • where do you have the js? on doc ready? on load? somewhere else?

    – Huangism
    Mar 28 at 18:38











  • It works on jsFiddle because by default they wrap your JavaScript in a window.load handler. If you're not also doing that, or not using document.ready, or not loading your JS at the end of the page, then you're probably running it too early

    – j08691
    Mar 28 at 18:39












  • My actual code has the JavaScript in a different file and is at the bottom of the page.

    – Switch
    Mar 28 at 18:50











  • Have you run your code with the dev tools console open to see if there are errors when it doesn't work properly?

    – j08691
    Mar 28 at 18:52











  • Yes.. Uncaught TypeError: $(...).dialog is not a function at HTMLInputElement.<anonymous> (question.js:8) at HTMLInputElement.dispatch (jquery.min.js:3) at HTMLInputElement.i (jquery.min.js:3)

    – Switch
    Mar 28 at 18:57













-1












-1








-1


1






I'm still new to JQuery, because I keep having weird issues like this with no error and that make no sense. It's not something I can google, though I have and I'm getting no where. So please tell me what I'm missing. I can make this work on jsfiddle, but fails everywhere else.






$(document).ready(function() 

var intID = null;


$('[delbtn]').click( function()
var msg = $('[delbtn]').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);

$('#DeleteButton').click( function()
var msg = $('#DeleteButton').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);
);

body 
margin: 10px;


input
margin: 20px;
display: block;


#PromptDialog
background-color: #000;
border-radius: 20px;
padding: 10px;


.ui-dialog, .ui-dialog-title
text-align: center;
width: 100%;


.ui-dialog-titlebar-close

display:none;


.ui-dialog .ui-dialog-buttonpane

text-align: center;
background: red;


.ui-widget-header, .ui-state-default
background:#b9cd6d;
border: 1px solid #b9cd6d;
color: #000;
font-weight: bold;


.ui-dialog

background: blue;
color: #fff;


.ui-dialog-content

color: #fff;


.ui-button.yesClass

background: green;
color: #000;


.ui-button.noClass

background: green;
color: #fff;


.ui-button.noClass.ui-state-hover,
.ui-button.noClass.ui-state-active,
.ui-button.yesClass.ui-state-hover,
.ui-button.yesClass.ui-state-active

background: red;
color: yellow;

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="PromptDialog" style="display:none;"></div>
<input type="button" id="DeleteButton" msg="Are you sure you want to delete it?" value="Delete This">
<input type="button" id="DeleteButton2" delbtn="1" msg="Wait, What ??" value="Delete This">
<div id="resposneText"></div>





JSFiddle Link










share|improve this question
















I'm still new to JQuery, because I keep having weird issues like this with no error and that make no sense. It's not something I can google, though I have and I'm getting no where. So please tell me what I'm missing. I can make this work on jsfiddle, but fails everywhere else.






$(document).ready(function() 

var intID = null;


$('[delbtn]').click( function()
var msg = $('[delbtn]').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);

$('#DeleteButton').click( function()
var msg = $('#DeleteButton').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);
);

body 
margin: 10px;


input
margin: 20px;
display: block;


#PromptDialog
background-color: #000;
border-radius: 20px;
padding: 10px;


.ui-dialog, .ui-dialog-title
text-align: center;
width: 100%;


.ui-dialog-titlebar-close

display:none;


.ui-dialog .ui-dialog-buttonpane

text-align: center;
background: red;


.ui-widget-header, .ui-state-default
background:#b9cd6d;
border: 1px solid #b9cd6d;
color: #000;
font-weight: bold;


.ui-dialog

background: blue;
color: #fff;


.ui-dialog-content

color: #fff;


.ui-button.yesClass

background: green;
color: #000;


.ui-button.noClass

background: green;
color: #fff;


.ui-button.noClass.ui-state-hover,
.ui-button.noClass.ui-state-active,
.ui-button.yesClass.ui-state-hover,
.ui-button.yesClass.ui-state-active

background: red;
color: yellow;

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="PromptDialog" style="display:none;"></div>
<input type="button" id="DeleteButton" msg="Are you sure you want to delete it?" value="Delete This">
<input type="button" id="DeleteButton2" delbtn="1" msg="Wait, What ??" value="Delete This">
<div id="resposneText"></div>





JSFiddle Link






$(document).ready(function() 

var intID = null;


$('[delbtn]').click( function()
var msg = $('[delbtn]').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);

$('#DeleteButton').click( function()
var msg = $('#DeleteButton').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);
);

body 
margin: 10px;


input
margin: 20px;
display: block;


#PromptDialog
background-color: #000;
border-radius: 20px;
padding: 10px;


.ui-dialog, .ui-dialog-title
text-align: center;
width: 100%;


.ui-dialog-titlebar-close

display:none;


.ui-dialog .ui-dialog-buttonpane

text-align: center;
background: red;


.ui-widget-header, .ui-state-default
background:#b9cd6d;
border: 1px solid #b9cd6d;
color: #000;
font-weight: bold;


.ui-dialog

background: blue;
color: #fff;


.ui-dialog-content

color: #fff;


.ui-button.yesClass

background: green;
color: #000;


.ui-button.noClass

background: green;
color: #fff;


.ui-button.noClass.ui-state-hover,
.ui-button.noClass.ui-state-active,
.ui-button.yesClass.ui-state-hover,
.ui-button.yesClass.ui-state-active

background: red;
color: yellow;

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="PromptDialog" style="display:none;"></div>
<input type="button" id="DeleteButton" msg="Are you sure you want to delete it?" value="Delete This">
<input type="button" id="DeleteButton2" delbtn="1" msg="Wait, What ??" value="Delete This">
<div id="resposneText"></div>





$(document).ready(function() 

var intID = null;


$('[delbtn]').click( function()
var msg = $('[delbtn]').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);

$('#DeleteButton').click( function()
var msg = $('#DeleteButton').attr("msg");
$('#PromptDialog').html(msg);
$('#PromptDialog').dialog(
title: "Delete Prompt",
autoOpen: true,
show: "blind",
hide: "explode",
modal: true,
width: "400px",
resizable: false,
buttons: [

text: "Yes",
class: "yesClass",
click: function ()
$('#resposneText').html('Yes was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

,

text: "No",
class: "noClass",
click: function ()
$('#resposneText').html('No was clicked');
$('#PromptDialog').dialog('close');
clearTimeout(intID);

],
open: function(event, ui)
intID = setTimeout(function()
$('#PromptDialog').dialog('close');
, 10000);

);
);
);

body 
margin: 10px;


input
margin: 20px;
display: block;


#PromptDialog
background-color: #000;
border-radius: 20px;
padding: 10px;


.ui-dialog, .ui-dialog-title
text-align: center;
width: 100%;


.ui-dialog-titlebar-close

display:none;


.ui-dialog .ui-dialog-buttonpane

text-align: center;
background: red;


.ui-widget-header, .ui-state-default
background:#b9cd6d;
border: 1px solid #b9cd6d;
color: #000;
font-weight: bold;


.ui-dialog

background: blue;
color: #fff;


.ui-dialog-content

color: #fff;


.ui-button.yesClass

background: green;
color: #000;


.ui-button.noClass

background: green;
color: #fff;


.ui-button.noClass.ui-state-hover,
.ui-button.noClass.ui-state-active,
.ui-button.yesClass.ui-state-hover,
.ui-button.yesClass.ui-state-active

background: red;
color: yellow;

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<div id="PromptDialog" style="display:none;"></div>
<input type="button" id="DeleteButton" msg="Are you sure you want to delete it?" value="Delete This">
<input type="button" id="DeleteButton2" delbtn="1" msg="Wait, What ??" value="Delete This">
<div id="resposneText"></div>






jquery






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 19:05







Switch

















asked Mar 28 at 18:31









SwitchSwitch

1,2999 silver badges22 bronze badges




1,2999 silver badges22 bronze badges















  • where do you have the js? on doc ready? on load? somewhere else?

    – Huangism
    Mar 28 at 18:38











  • It works on jsFiddle because by default they wrap your JavaScript in a window.load handler. If you're not also doing that, or not using document.ready, or not loading your JS at the end of the page, then you're probably running it too early

    – j08691
    Mar 28 at 18:39












  • My actual code has the JavaScript in a different file and is at the bottom of the page.

    – Switch
    Mar 28 at 18:50











  • Have you run your code with the dev tools console open to see if there are errors when it doesn't work properly?

    – j08691
    Mar 28 at 18:52











  • Yes.. Uncaught TypeError: $(...).dialog is not a function at HTMLInputElement.<anonymous> (question.js:8) at HTMLInputElement.dispatch (jquery.min.js:3) at HTMLInputElement.i (jquery.min.js:3)

    – Switch
    Mar 28 at 18:57

















  • where do you have the js? on doc ready? on load? somewhere else?

    – Huangism
    Mar 28 at 18:38











  • It works on jsFiddle because by default they wrap your JavaScript in a window.load handler. If you're not also doing that, or not using document.ready, or not loading your JS at the end of the page, then you're probably running it too early

    – j08691
    Mar 28 at 18:39












  • My actual code has the JavaScript in a different file and is at the bottom of the page.

    – Switch
    Mar 28 at 18:50











  • Have you run your code with the dev tools console open to see if there are errors when it doesn't work properly?

    – j08691
    Mar 28 at 18:52











  • Yes.. Uncaught TypeError: $(...).dialog is not a function at HTMLInputElement.<anonymous> (question.js:8) at HTMLInputElement.dispatch (jquery.min.js:3) at HTMLInputElement.i (jquery.min.js:3)

    – Switch
    Mar 28 at 18:57
















where do you have the js? on doc ready? on load? somewhere else?

– Huangism
Mar 28 at 18:38





where do you have the js? on doc ready? on load? somewhere else?

– Huangism
Mar 28 at 18:38













It works on jsFiddle because by default they wrap your JavaScript in a window.load handler. If you're not also doing that, or not using document.ready, or not loading your JS at the end of the page, then you're probably running it too early

– j08691
Mar 28 at 18:39






It works on jsFiddle because by default they wrap your JavaScript in a window.load handler. If you're not also doing that, or not using document.ready, or not loading your JS at the end of the page, then you're probably running it too early

– j08691
Mar 28 at 18:39














My actual code has the JavaScript in a different file and is at the bottom of the page.

– Switch
Mar 28 at 18:50





My actual code has the JavaScript in a different file and is at the bottom of the page.

– Switch
Mar 28 at 18:50













Have you run your code with the dev tools console open to see if there are errors when it doesn't work properly?

– j08691
Mar 28 at 18:52





Have you run your code with the dev tools console open to see if there are errors when it doesn't work properly?

– j08691
Mar 28 at 18:52













Yes.. Uncaught TypeError: $(...).dialog is not a function at HTMLInputElement.<anonymous> (question.js:8) at HTMLInputElement.dispatch (jquery.min.js:3) at HTMLInputElement.i (jquery.min.js:3)

– Switch
Mar 28 at 18:57





Yes.. Uncaught TypeError: $(...).dialog is not a function at HTMLInputElement.<anonymous> (question.js:8) at HTMLInputElement.dispatch (jquery.min.js:3) at HTMLInputElement.i (jquery.min.js:3)

– Switch
Mar 28 at 18:57












2 Answers
2






active

oldest

votes


















1
















Since your errors refer to a dialog() function, but jQuery doesn't have one, you need to also include after jquery, jquery UI.






share|improve this answer

























  • Thank you.. That was the trick.. Not sure who was Down arrowing my question, they obviously didn't know the answer, but like to bash someone else that asked the question..

    – Switch
    Mar 28 at 19:15


















1
















You mentioned a jQuery dialog error in a previous comment, it looks like you do not have jquery UI included in your code. Add this after jQuery to ffix that error:



<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>


Documentation for dialog: https://jqueryui.com/dialog/






share|improve this answer



























  • The Javascript is in it's own JS file. The load is from the bottom of the page.

    – Switch
    Mar 28 at 18:55











  • Is your site built with WordPress or any other CMS?

    – Jamie Burton
    Mar 28 at 19:04











  • I think i've worked it out, i will updfate my answer

    – Jamie Burton
    Mar 28 at 19:07











  • Yea, j08691 provided that 4 min before you and it was the problem. He posted it in comments and I was searching to figure that out. Only reason I'm giving it to him, but will get you an Up for points.. Thanks..

    – Switch
    Mar 28 at 19:13











  • no probs mate, glad its solved for you

    – Jamie Burton
    Mar 28 at 19:15













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/4.0/"u003ecc by-sa 4.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
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55404616%2fjquery-doesnt-work-at-times-and-im-not-sure-why%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









1
















Since your errors refer to a dialog() function, but jQuery doesn't have one, you need to also include after jquery, jquery UI.






share|improve this answer

























  • Thank you.. That was the trick.. Not sure who was Down arrowing my question, they obviously didn't know the answer, but like to bash someone else that asked the question..

    – Switch
    Mar 28 at 19:15















1
















Since your errors refer to a dialog() function, but jQuery doesn't have one, you need to also include after jquery, jquery UI.






share|improve this answer

























  • Thank you.. That was the trick.. Not sure who was Down arrowing my question, they obviously didn't know the answer, but like to bash someone else that asked the question..

    – Switch
    Mar 28 at 19:15













1














1










1









Since your errors refer to a dialog() function, but jQuery doesn't have one, you need to also include after jquery, jquery UI.






share|improve this answer













Since your errors refer to a dialog() function, but jQuery doesn't have one, you need to also include after jquery, jquery UI.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 28 at 19:13









j08691j08691

173k22 gold badges207 silver badges223 bronze badges




173k22 gold badges207 silver badges223 bronze badges















  • Thank you.. That was the trick.. Not sure who was Down arrowing my question, they obviously didn't know the answer, but like to bash someone else that asked the question..

    – Switch
    Mar 28 at 19:15

















  • Thank you.. That was the trick.. Not sure who was Down arrowing my question, they obviously didn't know the answer, but like to bash someone else that asked the question..

    – Switch
    Mar 28 at 19:15
















Thank you.. That was the trick.. Not sure who was Down arrowing my question, they obviously didn't know the answer, but like to bash someone else that asked the question..

– Switch
Mar 28 at 19:15





Thank you.. That was the trick.. Not sure who was Down arrowing my question, they obviously didn't know the answer, but like to bash someone else that asked the question..

– Switch
Mar 28 at 19:15













1
















You mentioned a jQuery dialog error in a previous comment, it looks like you do not have jquery UI included in your code. Add this after jQuery to ffix that error:



<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>


Documentation for dialog: https://jqueryui.com/dialog/






share|improve this answer



























  • The Javascript is in it's own JS file. The load is from the bottom of the page.

    – Switch
    Mar 28 at 18:55











  • Is your site built with WordPress or any other CMS?

    – Jamie Burton
    Mar 28 at 19:04











  • I think i've worked it out, i will updfate my answer

    – Jamie Burton
    Mar 28 at 19:07











  • Yea, j08691 provided that 4 min before you and it was the problem. He posted it in comments and I was searching to figure that out. Only reason I'm giving it to him, but will get you an Up for points.. Thanks..

    – Switch
    Mar 28 at 19:13











  • no probs mate, glad its solved for you

    – Jamie Burton
    Mar 28 at 19:15















1
















You mentioned a jQuery dialog error in a previous comment, it looks like you do not have jquery UI included in your code. Add this after jQuery to ffix that error:



<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>


Documentation for dialog: https://jqueryui.com/dialog/






share|improve this answer



























  • The Javascript is in it's own JS file. The load is from the bottom of the page.

    – Switch
    Mar 28 at 18:55











  • Is your site built with WordPress or any other CMS?

    – Jamie Burton
    Mar 28 at 19:04











  • I think i've worked it out, i will updfate my answer

    – Jamie Burton
    Mar 28 at 19:07











  • Yea, j08691 provided that 4 min before you and it was the problem. He posted it in comments and I was searching to figure that out. Only reason I'm giving it to him, but will get you an Up for points.. Thanks..

    – Switch
    Mar 28 at 19:13











  • no probs mate, glad its solved for you

    – Jamie Burton
    Mar 28 at 19:15













1














1










1









You mentioned a jQuery dialog error in a previous comment, it looks like you do not have jquery UI included in your code. Add this after jQuery to ffix that error:



<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>


Documentation for dialog: https://jqueryui.com/dialog/






share|improve this answer















You mentioned a jQuery dialog error in a previous comment, it looks like you do not have jquery UI included in your code. Add this after jQuery to ffix that error:



<script
src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
crossorigin="anonymous"></script>


Documentation for dialog: https://jqueryui.com/dialog/







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 28 at 19:09

























answered Mar 28 at 18:50









Jamie BurtonJamie Burton

2711 silver badge6 bronze badges




2711 silver badge6 bronze badges















  • The Javascript is in it's own JS file. The load is from the bottom of the page.

    – Switch
    Mar 28 at 18:55











  • Is your site built with WordPress or any other CMS?

    – Jamie Burton
    Mar 28 at 19:04











  • I think i've worked it out, i will updfate my answer

    – Jamie Burton
    Mar 28 at 19:07











  • Yea, j08691 provided that 4 min before you and it was the problem. He posted it in comments and I was searching to figure that out. Only reason I'm giving it to him, but will get you an Up for points.. Thanks..

    – Switch
    Mar 28 at 19:13











  • no probs mate, glad its solved for you

    – Jamie Burton
    Mar 28 at 19:15

















  • The Javascript is in it's own JS file. The load is from the bottom of the page.

    – Switch
    Mar 28 at 18:55











  • Is your site built with WordPress or any other CMS?

    – Jamie Burton
    Mar 28 at 19:04











  • I think i've worked it out, i will updfate my answer

    – Jamie Burton
    Mar 28 at 19:07











  • Yea, j08691 provided that 4 min before you and it was the problem. He posted it in comments and I was searching to figure that out. Only reason I'm giving it to him, but will get you an Up for points.. Thanks..

    – Switch
    Mar 28 at 19:13











  • no probs mate, glad its solved for you

    – Jamie Burton
    Mar 28 at 19:15
















The Javascript is in it's own JS file. The load is from the bottom of the page.

– Switch
Mar 28 at 18:55





The Javascript is in it's own JS file. The load is from the bottom of the page.

– Switch
Mar 28 at 18:55













Is your site built with WordPress or any other CMS?

– Jamie Burton
Mar 28 at 19:04





Is your site built with WordPress or any other CMS?

– Jamie Burton
Mar 28 at 19:04













I think i've worked it out, i will updfate my answer

– Jamie Burton
Mar 28 at 19:07





I think i've worked it out, i will updfate my answer

– Jamie Burton
Mar 28 at 19:07













Yea, j08691 provided that 4 min before you and it was the problem. He posted it in comments and I was searching to figure that out. Only reason I'm giving it to him, but will get you an Up for points.. Thanks..

– Switch
Mar 28 at 19:13





Yea, j08691 provided that 4 min before you and it was the problem. He posted it in comments and I was searching to figure that out. Only reason I'm giving it to him, but will get you an Up for points.. Thanks..

– Switch
Mar 28 at 19:13













no probs mate, glad its solved for you

– Jamie Burton
Mar 28 at 19:15





no probs mate, glad its solved for you

– Jamie Burton
Mar 28 at 19:15


















draft saved

draft discarded















































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.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55404616%2fjquery-doesnt-work-at-times-and-im-not-sure-why%23new-answer', 'question_page');

);

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







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현