开发者

Get an alert box to popup at the jquery event $(document).ready in smarty template

I'm juuuuuust trying to get an pop up displaying test when the document is ready. I've managed to get开发者_Go百科 google maps working on another page but somehow this is a lot of pain.

Here's the code:

<html>
    <head>
[...]
        <script type="text/javascript" href="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
        {literal}
        <script type="text/javascript">
            $(document).ready(function () {
                alert ("test");
});
        </script>
        {/literal}
    </head>
[...]
</html>

What should I do to get that popup message? I also tried copy pasting from my working jquery page without much success.


Changing <script href=...> to <script src=...> works like a charm for me.


Does you javascript is enabled in your browser ?

You can type this:

$(function() {
  alert("test");
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜