2

For a Google site, I want a page to display content based on the url parameters.

Eg. http://sites.google.com/../mypage?id=123

Then I want to make a HTTP request using the id and display the result on the page.

Or I want to use App Scripts to perform something and display the result on the page.

How can I do so?

2 Answers 2

3

Use on Google app script

function doGet(e){
// id in your Url. example :   http://sites.google.com/../mypage?myidok=123
var element - e.parameters.myidok

// code 
// your app 

}
Sign up to request clarification or add additional context in comments.

1 Comment

This doesn't work with the new google sites when embedding a google script.
2

See this answer for an example of serving multiple html pages using HtmlService. The basic idea is to write doGet() to accept a query parameter that it will use to select which html page to serve.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.