twb
twb

Reputation: 1368

How can I get url parameters from a google sites page

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?

Upvotes: 2

Views: 3668

Answers (2)

Mogsdad
Mogsdad

Reputation: 45740

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.

Upvotes: 2

Hann
Hann

Reputation: 713

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 

}

Upvotes: 3

Related Questions