How I get a variable from java script to use it in the scriptlet of jsp.
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');
View Answers
January 19, 2012 at 12:19 PM
<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);
}
%>
January 19, 2012 at 12:21 PM
<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>
January 19, 2012 at 12:21 PM
<html>
<script>
var v="Roseindia";
</script>
<% String st="<script>document.writeln(v)</script>";
out.println("value="+st); %>
</html>
Ads
Related Tutorials/Questions & Answers:
How do I read a variable from a file in shell script
to read some of the variables
from other file and then
use this in spark submit command.
How do
I read a
variable from a file in shell
script and then
use...
How do
I read a
variable from a file in shell script Hi,
In my
Advertisements
How to save and get value from JSP
How to save and
get value
from JSP Employee Name Time... 324 2012-12-12
save
i want to save dis value
jsp to action ...
how can
i get all value ..and store..
how can its values goes
how to get data from database into dropdownlist in jsp
how to
get data
from database into dropdownlist in jsp Can anybody tell me what is the problem in this code as
i am not able to fetch the data
from... tutorial go through the link
JSP Get Data Into Dropdown list
From Database
 
jsp scriptlet
jsp scriptlet can a method defined in the
jsp scriptlet
Extracting variable from jsp
Extracting
variable from jsp
how to Write a
java program which will be extracting the variables and putting them in an excel format?
 ..., these field values will
get inserted into the excel file.
1)Create form.jsp
<html>
is it possible to use jsp in java script
is it possible to
use jsp in
java script is it possible to
use jsp inside the javascript while using
java script in body tag on that time
i am calculate number of records in mysql, so that
i am using jsp.if count value
is it possible to use jsp in java script
is it possible to
use jsp in
java script is it possible to
use jsp inside the javascript while using
java script in body tag on that time
i am calculate number of records in mysql, so that
i am using jsp.if count value
How to get data from Oracle database using JSP
How to
get data
from Oracle database using JSP hello
i have a simple problem in
jsp in the sense to
get data
from the database like oracle .
I have... in the sense to
get data
from the database like oracle .
I have created one
jsp
How can I get specific data from JSON
How can
I get specific data
from JSON Hi,
How can
I get specific data
from JSON?
Thanks
Hi,
In Python you can
use the json library... shows
how you can
get the user
from the json:
>>> import json
>>>
How to get the values from the Combo Box - JSP-Servlet
How to
get the values
from the Combo Box
Sir,
Actually
i am getting the values in the combo box
from table.I want what ever... in their respective text box.
e.g suppose
i select ram values
from the combo box and its