Doing great work man, not one else really making these types of content
@rustyalminar72293 жыл бұрын
Great Tutorial! But how can i get value in url to myHtml(outside of googlescript)
@davidebonzi64764 жыл бұрын
Hi, I want to redirect to a page with a different parameter value if the login is succes, but I'm unable to change the query string in the URL. I wrote the same things as shown in line 26, but the URL doesn't change. It only works if i use the href directly in the HTML, but I don't want that since I want to redirect only if certain conditions are met. any idea why?
@DavidWeissProgramming4 жыл бұрын
Hi! Hm interesting, this should work for you exactly as it does for me. I hope to upload all my code to Github within the next couple days/weeks so that viewers can follow along better, but some ideas on why it may not be working are: 1) Your button needs to be an anchor tag not a button 2) If you are using getElementById() make sure the element's ID is indeed unique 3) Since we are using a scriptlet to inject the URL of the web app into the address bar, just make sure the HTMLService on your back end code is creating an HtmlTemplateFromFile() not HtmlOutputFromFile(). Let me know if these suggestions helped, or if not, feel free to paste the code here so we could have a closer look!
@philipevangelista30203 жыл бұрын
@@DavidWeissProgramming Hi David, I really appreciate this. I also came across the same problem as mentioned above. Two issues actually. I've been on this for a few weeks now and couldn't find a proper solution. I'm using GAS V8 engine. The scriplets () don't seem to work inside the script tags of the client side. The other issue is the above code, on V8 returns the EXEC (not the dev) url. In contrast, the older version returns the DEV site. However, when I try to create a string variable from the server side and pass it to my client, it only returns the EXEC url, regardless of the engine used. So it's kind of a hassle doing trial and error if I can't do that during development. Anyway, I hope that somehow made sense. Would appreciate any response from you! Thank you!
@grupointeli4 жыл бұрын
Hi David, first of all thank you for your excellent videos. I am trying to use parameters with getLocation and it works excellent when I host my webApp inside GAS, the problem is that I use google sites to host my webApp and it doesn't work. This is my code: document.addEventListener('DOMContentLoaded', function() { google.script.url.getLocation(location => { document.getElementById("contract").value = location.parameter.cn; }); results: url GAS: "script.google.com/macros/s/AKfycbwYO1MFhUPkDtxL4ZQ3k9FnkmH6JbxfU3L1eh_GJZM/dev?cn=11105" url(google sites): "sites.google.com/view/fu-rcp-asesor/rcp?cn=11105" Hosted in GAS: location.parameter.cn = 11105 Embedded in google sites: location.parameter.cn = undefined
@cuneiformscript26654 жыл бұрын
🙏🏻👏👍🏻
@grupointeli4 жыл бұрын
Hi David, first of all thank you for your excellent videos. I am trying to use parameters with getLocation and it works excellent when I host my webApp inside GAS, the problem is that I use google sites to host my webApp and it doesn't work. This is my code: document.addEventListener('DOMContentLoaded', function() { google.script.url.getLocation(location => { document.getElementById("contract").value = location.parameter.cn; }); results: url GAS: "script.google.com/macros/s/AKfycbwYO1MFhUPkDtxL4ZQ3k9FnkmH6JbxfU3L1eh_GJZM/dev?cn=11105" url(google sites): "sites.google.com/view/fu-rcp-asesor/rcp?cn=11105" Hosted in GAS: location.parameter.cn = 11105 Embedded in google sites: location.parameter.cn = undefined