Your code is full of the worst part of JavaScript.
1. All your variables are globals - as no
var
used to declare them. A huge mistake!!!
2. If you write a function to return a value then use that value!!!
---
function myTest(){
alert("This is UI Page " + getVaria());
}
..and...
function getVaria(){
var strStartDate = document.getElementById("from_date").value;
var strEndDate = document.getElementById("to_date").value;
var strWsUrl = "https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A76546294&dimensions=ga%3Asource&metrics=ga%3Ausers&filters=ga%3Asource!%3D(direct)&sort=-ga%3Ausers&start-date=' + strStartDate + '&end-date=' + strEndDate + '&max-results=10";
alert(strStartDate);
alert(strEndDate);
alert(strWsUrl);
return strWsUrl;
}
---
Do yourself a favor! Stop for a week and read some decent book about programming with JavaScript. Your development can go so wrong with JavaScript (it's a language permitting any kind of idiotic things) if you do not understand its base...