官术网_书友最值得收藏!

Creating and managing scripts

JavaScript scripts are added to a solution package just like any other resource. They are becoming part of the package, and thus are easily portable to other environments, along with the solution.

Getting ready

Using the existing solution package we have created, we will be adding a new JavaScript resource.

How to do it...

To add a new JavaScript resource, navigate to Settings, and open your existing solution package. Follow these steps to add a script resource:

  1. In the package, navigate to Web Resources.
  2. In the Web Resources view, select New to add a new script resource.
    How to do it...
  3. Give the resource a name, and select the Script (Jscript) option from the Type drop-down list. The Display Name should be in a readable format. It is good practice to always add a Description for other developers that will follow in your foot steps to easily identify the content of the library without having to open the file.
    How to do it...
  4. Click on Save, and then on Publish. Now you have a JavaScript resource added to your solution package. There is no actual script added yet, so let's do that.
  5. Click on the Text Editor button. A new form will open allowing you to type in your script.
    How to do it...
  6. Click OK, then Save and Publish your resource again.
  7. Now we have a script added as part of the solution package. It is not related to any action, but we will cover that in one of the later recipes.

Sometimes a script resource can become obsolete, and we would want to remove it. In order to remove a script resource that is not associated with any other system entities, perform the following steps:

  1. From the Web Resources view, select the script.
  2. Click on Delete.
  3. Make sure to click on Publish all Customizations for the changes to take effect. Now your script resource has been removed.
主站蜘蛛池模板: 阜康市| 汉寿县| 邓州市| 华坪县| 宣汉县| 公安县| 尼勒克县| 当涂县| 黄龙县| 柘城县| 紫云| 太康县| 新巴尔虎左旗| 彭水| 林口县| 永顺县| 无棣县| 蓬溪县| 桃园县| 塘沽区| 沛县| 开化县| 信丰县| 武宣县| 湄潭县| 汉中市| 荥经县| 普安县| 古丈县| 塔城市| 南靖县| 宜宾市| 绥化市| 客服| 水富县| 崇信县| 庆阳市| 辉县市| 多伦县| 申扎县| 鄂州市|