
Hi i want to get the tinyUrl value in the scriptlet of jsp.
// Bit.ly API
var url="http://cplive.com/dealDetail.do?method=displayDealDetail&class=moreRewards&dealID=27";
var tinyUrl;
BitlyCB.shortenResponse = function(data)
{
var first_result;
// Results are keyed by longUrl, so we need to grab the first one.
for (var r in data.results)
{
first_result = data.results[r]; break;
}
tinyUrl = first_result["shortUrl"].toString();
document.getElementById("qlink").value = tinyUrl;
}
BitlyClient.shorten(url, 'BitlyCB.shortenResponse');

<html>
<script>
function selValue(){
var mytext = document.form.sel.options[document.form.sel.selectedIndex].text;
window.location.replace("pass.jsp?value="+mytext);
}
</script>
<form name="form" >
<select name="sel" id="sel" onchange="selValue();">
<option value="<-Select->"><- Select- ></option>
<option value="India">India</option>
<option value="USA">USA</option>
<option value="Srilanka">Srilanka</option>
<option value="Japan">Japan</option>
<option value="Australia">Australia</option>
</select>
</form>
<% String st=request.getParameter("value");
if(st!=null){
out.println("value="+st);
}
%>

<html>
<script language="javascript" type="text/javascript">
function call(){
var name = "roseindia";
window.location.replace("a.jsp?name="+name);
}
</script>
<input type="button" value="Get" onclick='call()'>
<%
String name=request.getParameter("name");
if(name!=null){
out.println(name);
}
%>
</html>

<html>
<script>
var v="Roseindia";
</script>
<% String st="<script>document.writeln(v)</script>";
out.println("value="+st); %>
</html>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.