3

Jenkins で JavaScript で記述されたスクリプトを使用しようとしています。簡単な方法は、.jelly スクリプトで呼び出すことだと思います。例:私はファイルを持っています

myCustom.js :

alert("Hello World!");
function myFunction() {
    var x = "", i;
    for (i=0; i<5; i++) {
        x = x + "The number is " + i + "<br>";
    }
    document.getElementById("demo").innerHTML = x;
}

次に私が持っている: global.jelly (チュートリアル プラグインから):

<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
  <f:section title="Hello World Builder">
    <f:entry title="French" field="useFrench"
      description="Check if we should say hello in French">
      <f:checkbox />
      <script type="text/javascript" src="${resURL}/myCustom.js"> 
      </script>
    </f:entry>
  </f:section>
</j:jelly>

問題は、効果がないことです。Hello Worldアラートでさえ表示されません...何が間違っていますか? 私が使用する場合:

<script type="text/javascript" >
    alert("Hello World!");
</script>

in jelly, it shows allert window, but I cannot call entire document. Maybe "${resURL}/myCustom.js" is not pointing correctly? where should I put my JS file?

One more thing: I've seen other question on Stack, but there is no working anwser, and I can't contact to owner of that one.

4

2 に答える 2