GAS & HtmlService embedded in google site href management - html

I'm working on a Google Site:
An input page uses HtmlService with a form that fills a line in a spreadsheet.
An edit page shows the data with handsometable gadget.
In every handsometable's line, there is a link to edit some information using the same script of the input page.
All works fine, but I have some problems after submit.
In the input page it's ok, with this code
new input
The href is filled with the script url, clicking the link I go to input page.
In the edit page I'd like to go back to the page with the table, with this code:
table
but using the link I open the Google site in a frame into the page..
can i do something?
Thanks
Marco
Hope this image better explain the question...
some snapshoots http://imagizer.imageshack.us/a/img537/3748/OUzFV1.jpg

Related

How to make a search box search google with HTML?

Lately, I've been working on a page in html which is supposed to search Google. I have a search box and a button but I'm wondering what the most efficient way to get the results from Google and display them on my page. If anyone knows I'd be glad if they helped me out.
{EDIT}
This is just a little project I'm working on. To be more specific I'd like to make it where what is typed in the search box gets taken from www.google.com/search and then the results of the Google search are displayed below.
Answer & Demo
You can create a custom google search engine for your sites, follow the steps, then get the code and paste it in a div inside the body tag. Here is a JSFiddle with an example of this (site:stackoverflow.com).
You can then edit the way the engine looks in the look and feel tab in the edit search menu.
Hope this helps, good luck! :)
So you're saying you want an HTML page with a single input and a submit button.
When the user enters text into the input and then presses submit what would you like to happen?
I see two basic approaches.
Pass the search string as a parameter in the URL so the next page can be made aware of it using javascript. then use xmlhttprequest to grab the data from google and do a document.write to render the information to the user:
example
Insert a Div with some id in the page and then use the submit's onclick attribute to initiate an AJAX call that gets the data from google and then inserts it into the div's innerHTML without the need for multiple pages.
[UPDATE}
after looking into this it seems that XMLHttpRequest will not work with google and that the API is the way to go.
source

How to create custom theme for Google Form?

I wanted an embed Google Form in my website so i grabbed embed code and pasted it in my page.
<iframe src="https://docs.google.com/forms/d/1u1NO8u4vu6Q9XuUNigo4qy22hjvRmL-HFIRVsgiaL9c/viewform?embedded=true" width="760" height="500" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
(that's what Google gave me)
Everything is working fine BUT it's an iframe so I can't edit it's appearance using CSS. Google Docs' deafult themes don't match my site so I want to this page's CSS. I tried downloading https://docs.google.com/forms/d/1u1NO8u4vu6Q9XuUNigo4qy22hjvRmL-HFIRVsgiaL9c/viewform as html but this way I didn't get the css file. Do I have to create it by myself or there's another solution to my problem?
You can simply copy the form section of the html and copy paste to your page. It will post to google, and you still have full control over it.
You can't style it while it's an iframe.
see here for more tips about this:
http://morning.am/tutorials/how-to-style-google-forms/
You should use a <form> tag instead of embedding Google form. This is because the style from embedded form may not match your website scheme.
Here is how you can do it.
Create a Google Form.
Get the link and open the form in a new tab.
Create a barebone form having same items as the Google form.
Inspect Google form for action attribute.
a. Copy the same action to your form.
Inspect and find values for attributes name in the Google form.
a. Give the same name values for your form items as well. The values look like entry.742532386.
Check if your form gets the responses.
Read more here

How do I make a link for jumping to another section of the page?

I'm making an apps script on a Google site, and I'm embedding it with a gadget. I would like to make a link within the gadget that can jump down to another section of the page, but I have not found a way to do this. I found the anchor command, but it opens the link in a new page by default.
Is there any way to jump to a specific section of a page using apps script without re-loading the page in a new window?
Thank you
What you are looking for is an anchor tag. Check this reference: https://developers.google.com/apps-script/class_anchor

Get source code instead iframe

How I can get source code of iframe but to show all web site code who is in iframe when I click in my browser (right click/source code)...
Here is my code: http://jsfiddle.net/XWgnU/
UPDATE: What I'm need is to put URL in text field enter Submit and show the page with they source code below. Is it possible?
You can't run JavaScript on a third party page loaded in my browser, with my cookies, my ip address and anything else that site might use to authenticate me.

form post in Chrome extension popup not doing anything

I am making a chrome extension and I have a popup.html page that contains a form with method post, it does not do anything when opened using the popup button however if the page is opened as an options page or just a normal html page, the form posts fine and the new page is loaded.
so something in the popup is preventing the form from working.
I cannot figure out why, anyone know how to fix/work around this ?
You need to do an AJAX POST request. A quick Google search brought up this post.
Maybe an answer duplicate of Paypal Button For Google Chrome Extension.
Just in case that somebody arrives here, try adding a simple target="_blank" to your tag (Works with Paypal donate buttons, for example)