Skip to content

$.ajaxSetup({dataType:'json'}) を設定するとテンプレートの読み込みに失敗する #396

@mtakeuchi

Description

@mtakeuchi

$.ajaxSetup()で dataType:'json' を設定後、コントローラで.ejsファイルに書かれているテンプレートをロードしようとすると

[ERROR]14:49:58,206: テンプレートファイルを取得できませんでした。ステータスコード:200, URL:http://localhost:8080/xxxxxxx/template/test.ejs h5.js:2716
[ERROR]14:49:58,206: コントローラ"HogeController"のテンプレートの読み込みに失敗しました。URL:http://localhost:8080/xxxxxx/template/test.ejs 

というエラーが発生する。

  • test.ejs
<script type="text/ejs" id="tmpl1"></script>
  • test.js
$(function() {
  $.ajaxSetup({dataType:'json'});

  h5.core.controller('body', {
    __name: 'HogeController',
    __templates: 'template/test.ejs'
  });
});

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions