get current page url
You can get the url for a webapp via ScriptApp:
<a href="<?= ScriptApp.getService().getUrl() + "?item=xyz" ?>" >Item xyz link</a>
and you can get the url in sites via SitesApp:
SitesApp.getActivePage().getUrl()
although I don't think that's actually useful for what you seem to be describing since you can't add useful query parameters to it. Scripts run in iframes, so although you can use document.location on the client, it won't help you anyways. The URL is sanitized and the service id is stripped out.
how to open multiple url through code, we have a code but its for only one url
Withwindow.open
you can open as many windows as you wantSample to open two urls in two different windows:
function myFunction() {
var js = " \
<script> \
window.open('https://stackoverflow.com/', '_blank', 'width=800, height=600'); \
window.open('https://www.wikipedia.org/', '_blank', 'width=800, height=600'); \
google.script.host.close(); \
</script> \
";
var html = HtmlService.createHtmlOutput(js)
.setHeight(10)
.setWidth(100);
SpreadsheetApp.getUi().showModalDialog(html, 'Now loading.');
}
Related Topics
How to Include External JavaScript Library in Reactjs
How to Apply the Length Condition on the Existing Regular Expression
How to Load All the Images from One of My Folder into My Web Page, Using Jquery/Javascript
How to Import File from Public Folder in React Application
Converting String Date in React/Javascript
Javascript: Replace Last Occurrence of Text in a String
Dynamically Add Variable Name Value Pairs to Json Object
Check If a Number Has a Decimal Place/Is a Whole Number
Save Embedded Pdf from Website
Wait for Http Request in Angular
Remove Whitespace Inside Json Object Key Value Pair
Break the Loop of an Array Looping Function (Map, Foreach, etc.)
Regex: Match a Word With Exactly One Occurrence of a Specified Character At the Beginning
Retrieving Keys from Json Array Key-Value Pair Dynamically - JavaScript
Angular 2 Concatenate Variable in Interpolation