I am the newbie of google-apps-script, but I do not believe I have a problem. I can not even get Hello World! For example, working as a web app.
I have copied and pasted the code from Google's documentation website, and I still can not get it to work. (I had tried more complex stuff before, but by then I started trying simple and simple code until I got out of the problem below.)
When I started a web -We publish the following code as an app:
function doGet () {ContentService.createTextOutput Return ('hello, world!'); }
"Hello, world!" Instead of viewing in the browser, I get the following error message:
The script completed but nothing returned
I'm really in a loss. I do not know how to try something simple, and then, the code snippet given above was copied and pasted directly from the content service documentation page ().
Any help with this problem is greatly appreciated.
Thanks in advance.
Thanks for the reaction Allen.
I created a new project and pasted the Hello World code in it, and it worked, I will go ahead and work with this new project.
...
Now I have some more minute experience, I think my problem was with version control. I thought that when I made changes to my code and updated the current version, the current version published as a web app would show this change in my code. However, it seems that you have to create a new version of your code for your newly published Web-App to reflect the most recent changes in your code. My problem was that I was not producing new versions as I changed my code, so I reached the old code which was always similar to that version when that version was created for the first time.
(Using the Test Web App for your latest code link ( deployed as a web app dialog that comes from the Publish menu) reflects my most recent changes, but for my test purposes it was not enough because I argued on my web app url ( latest code link will only send your web app to your web app Calls a readable version of the URL in which it does not have any logic.) Also all logic added to the URL to test the web app, one for those changes that will be published in that web app Under the second version, the new code will need to be republished only. Only then can I access this URL which points to my latest code
Then, just the web application The Em> dialogue in the dialogue is not updating the current version with your new code, without specifying a new version doc. In order to deploy your latest / latest code, you will have to create a new version of your code that will reflect your latest changes. To create a new version, you first have to select Manage Versions ... from the File menu and then save a new version Save the new version indicates your most recent code change. Once you do this, you deployed as a web app < / Em> dialog to publish this new version. Your web app's URL will then be used by any version of your code that was posted / published by you.
I know that everyone here knows probably already, but I thought what was my problem (problem understanding the workflow of code-published cycle) In the future, any newbie will also have this problem Moves in
& lt; & Lt; & Lt; & Lt; & Lt; Update >>>>>
See the answer from Serge about how to use the Dev version of your web app URL with the attached criteria below it . In many cases, this can reduce the need to create new versions of your web app as I have described above / when you are only making incremental changes to your code.
Enter your dev url in the browser address bar so that you can copy it for more use (script.googleusercontent.com ... urls which temporarily serve the contents of your web app / output Instead) instead of calling an undefined function in your web app code then the Dev version of your web application, test web for your latest code link Use the app will return an error page, And then your DR URL will be available to copy in the browser address bar.
Comments
Post a Comment