javascript - jalert not working - Stack Overflow

I have following script:<script type="textjavascript" src="jquery-1.8.2.js">

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
 |  Show 2 more ments

1 Answer 1

Reset to default 6

jAlert 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

相关推荐

  • javascript - jalert not working - Stack Overflow

    I have following script:<script type="textjavascript" src="jquery-1.8.2.js">

    2天前
    80

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信