开发者

jquery not running in python using google app engine

I am a fresher in python. I want to run jquery datatable in python i have separate html file. My tag is running in html output by using App Engine but i have implemented datatable with my html table but it is just showing stuff not executing datatable function. I have included all css and jqueries. It is showing alert in javascript tag but not in $document.ready it means this function is not running. So obviously datatable will not bind with this table. Please help me! thanks a tonne in advance...

<html>
<head>
<style type="text/css" title="currentStyle">
 @import "Dat开发者_Go百科aTables/media/css/demo_page.css";
 @import "DataTables/media/css/demo_table.css";
 @import "DataTables/media/css/demo_table_jui.css";
 @import "DataTables/development-bundle/themes/smoothness/jquery-ui-1.8.6.custom.css";
</style>

<script type="text/javascript" language="javascript" src="jquery.js"></script>
<script type="text/javascript" language="javascript" src="DataTables/media/js/jquery.dataTables.js"></script>
<script type="text/javascript" language="javascript" src="DataTables/media/unit_testing/tests_onhold/1_dom/bJQueryUI.js"></script>

<script type="text/javascript">
alert ("Entered in javascript...");

$(document).ready(function(){
alert("Got it...");
$("#display").dataTable({
                "bJQueryUI":true
});
});
</script>
</head>


<body>
<table id="display">
    {% for greeting in greetings %}
        {% if greeting.author %}
            <tr><td><b>{{greeting.author.nickname }}</b> wrote:</td>
        {% else %}
            An anonymous person wrote:
        {% endif %}
            <td><blockquote>{{ greeting.content|escape }}</blockquote></td></tr>
    {% endfor %}
<tr><td>
    <form action="/sign" method="post">
      <div><textarea name="content" rows="3" cols="60"></textarea></div>
      <div><input type="submit" value="Sign Guestbook"></div>
    </form>
</tr></td></table>

</body>
</html>

alright this is my code... now where i am wrong...


I think you have the wrong url to the jquery file. I copied your code. When I changed the jquery script line to the following, I got the second alert.

<script type="text/javascript" language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

You seem to be confused about what runs on the client, and what runs on the server. Reading this and this should give you a better understanding.

I recommend that you use something like firebug to help you find client side problems. In this case, you would have easily seen that the url was wrong in then net tab of firebug.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜