开发者

How to call several addOnLoad functions in dojo?

I'm trying to define several dojo elements from several (inherited) HTML pages , and each defines addOnLoad of his own, which causes only the latest function to be executed, since they are overridden.

Is the开发者_JS百科re a way to overcome this problem?

Thanks.


You can use blocks to replace inherited elements

in template-base:

<head>
  <script type="text/javascript" src=""></script>
  {% block extra-header %} 
    #code default
    ...
  {% endblock %}
</head>

in template:

{% block extra-header %} 
{{ block.super }}
   #replacement code
   ...
   <script type="text/javascript" src=""></script>
{% endblock %}

for more information see https://docs.djangoproject.com/en/1.3/topics/templates/#template-inheritance

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜