1
사용자의 입력을 기반으로 일부 매개 변수를 포함하는 URL을 생성하고 싶습니다. 앵커가 있고 addMouseDownHandler 또는 addClickHandler를 사용하여 앵커의 링크를 변경할 수 있습니다. 문제는이 앵커를 두 번 클릭 한 후에 만 변경된 링크가 활성화되고 앵커를 처음 클릭 할 때 지정된 URL이 활성화된다는 것입니다.href를 변경하기 전에 앵커가 URL을 활성화합니다.
function onMouseDownAnchor(e)
{
Logger.log(JSON.stringify(e));// you can see the source parameter in e that returns the widgets ID of the button you clicked to call the handler
var app = UiApp.getActiveApplication();
var btnAnchor = app.getElementById('btnAnchor');
var newLink = 'http://www.google.com';
btnAnchor.setHref(newLink)
Logger.log('onMouseDownAnchor');
return app;
}
앵커가 클릭 할 때 앵커가 활성화되기 전에 앵커의 href를 어떻게 변경할 수 있습니까?