I have following script:
<script type="text/javascript" src="jquery-1.8.2.js"></script>
<script type="text/javascript">
jAlert("message","title");
</script>
in my html head.but the dialog is not showing up when I load the page(it would if I simply use alert).
where did I do wrong? Am I missing the corresponding js files?
edit: I included the jquery.alerts.js file.it is still not working.
edit: I added this line and put the file in the dir
<script type="text/javascript" src="jquery.alerts.js"></script>
Yes I put it inbetween.
I opened the browser console and saw this:
"Uncaught TypeError: Cannot read property 'scrollHeight' of null jquery-1.8.2.js:9405"
I have following script:
<script type="text/javascript" src="jquery-1.8.2.js"></script>
<script type="text/javascript">
jAlert("message","title");
</script>
in my html head.but the dialog is not showing up when I load the page(it would if I simply use alert).
where did I do wrong? Am I missing the corresponding js files?
edit: I included the jquery.alerts.js file.it is still not working.
edit: I added this line and put the file in the dir
<script type="text/javascript" src="jquery.alerts.js"></script>
Yes I put it inbetween.
I opened the browser console and saw this:
"Uncaught TypeError: Cannot read property 'scrollHeight' of null jquery-1.8.2.js:9405"
Share Improve this question edited Nov 6, 2012 at 2:37 Fermat's Little Student asked Nov 6, 2012 at 2:06 Fermat's Little StudentFermat's Little Student 6,3497 gold badges52 silver badges70 bronze badges 7-
1
You have included the jQuery source, but I see no
<script>
tag including the jAlert source. – Michael Berkowski Commented Nov 6, 2012 at 2:10 - Please update your code above to reflect your changes. – Shadow Commented Nov 6, 2012 at 2:22
- Did you put this between the jquery include, and your script? (It's needs jquery to work, and your script needs jalerts to work) - I've updated my answer to add more clarity to the ment. – Shadow Commented Nov 6, 2012 at 2:29
- I'm afraid it works for me - so you've done something odd. It's hard to say what from here, but I would start by double checking your filenames. (You are definitely using jquery version 1.8.2 etc) What browser are you using as well? (Not that it should matter) – Shadow Commented Nov 6, 2012 at 2:35
- My jquery version is correct. – Fermat's Little Student Commented Nov 6, 2012 at 2:41
1 Answer
Reset to default 6jAlert isn't a part of native jQuery.
You can find the project page here, the download link is at the bottom.
Make sure you include it straight after jQuery - your code should look as follows:
<link rel="stylesheet" type="text/css" href="jquery.alerts.css" />
<script type="text/javascript" src="jquery-1.8.2.js"></script>
<script type="text/javascript" src="jquery.alerts.js"></script>
<script type="text/javascript">
$(document).ready(function(){
jAlert("message","title")
});
</script>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744847405a4596923.html
评论列表(0条)