Tắt quyền truy cập vào tập lệnh dưới dạng ứng dụng web.
Tài liệu chi tiết
getUrl()
Trả về URL của ứng dụng web, nếu ứng dụng đó đã được triển khai; nếu không, trả về null. Nếu bạn đang chạy ứng dụng web ở chế độ phát triển, thì thao tác này sẽ trả về URL của chế độ phát triển.
// Mail the URL of the published web app.MailApp.sendMail('[email protected]','My Snazzy App',`My new app is now available at ${ScriptApp.getService().getUrl()}`,);
Cầu thủ trả bóng
String – URL của ứng dụng web
isEnabled()
Trả về true nếu có thể truy cập vào tập lệnh dưới dạng ứng dụng web.
Cầu thủ trả bóng
Boolean – true nếu tập lệnh được phát hành dưới dạng ứng dụng web; false nếu không
Các phương thức ngừng hoạt động
disable()
Không dùng nữa. Hàm này không còn được dùng nữa và không nên được sử dụng trong các tập lệnh mới.
Tắt quyền truy cập vào tập lệnh dưới dạng ứng dụng web. Phương thức này tương đương với việc mở hộp thoại "Xuất bản > Triển khai dưới dạng ứng dụng web" rồi nhấp vào "tắt ứng dụng web".
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eScriptApp\u003c/code\u003e service allows you to control and interact with the deployment of your script as a web application.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve the web app's URL using \u003ccode\u003egetUrl()\u003c/code\u003e, check its accessibility status with \u003ccode\u003eisEnabled()\u003c/code\u003e, and previously, disable it using the now deprecated \u003ccode\u003edisable()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edisable()\u003c/code\u003e method has been deprecated and should no longer be used in new scripts, replaced by the "Publish > Deploy as web app" dialog for disabling.\u003c/p\u003e\n"],["\u003cp\u003eWhen deploying your script as a web app, you can use provided methods to obtain its URL and determine if it's enabled for access.\u003c/p\u003e\n"]]],[],null,["Service\n\nAccess and manipulate script publishing. \n\nMethods\n\n| Method | Return type | Brief description |\n|-----------------------------|-------------|------------------------------------------------------------------------------------|\n| [getUrl()](#getUrl()) | `String` | Returns the URL of the web app, if it has been deployed; otherwise returns `null`. |\n| [isEnabled()](#isEnabled()) | `Boolean` | Returns `true` if the script is accessible as a web app. |\n\nDeprecated methods\n\n| Method | Return type | Brief description |\n|-------------------------|-------------|-------------------------------------------------------|\n| [disable()](#disable()) | `void` | Disables the script from being accessed as a web app. |\n\nDetailed documentation \n\n`get``Url()` \nReturns the URL of the web app, if it has been deployed; otherwise returns `null`. If you\nare running the development mode web app, this returns the development mode url.\n\n```javascript\n// Mail the URL of the published web app.\nMailApp.sendMail(\n '[email protected]',\n 'My Snazzy App',\n `My new app is now available at ${ScriptApp.getService().getUrl()}`,\n);\n```\n\nReturn\n\n\n`String` --- the URL of the web app\n\n*** ** * ** ***\n\n`is``Enabled()` \nReturns `true` if the script is accessible as a web app.\n\nReturn\n\n\n`Boolean` --- `true` if the script is published as a web app; `false` if not\n\nDeprecated methods \n\n`disable()` \n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nDisables the script from being accessed as a web app. This method is equivalent to opening the\n\"Publish \\\u003e Deploy as web app\" dialog and clicking \"disable web app\".\n\n```javascript\nScriptApp.getService().disable();\n```"]]