i have this code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("language", "1");
function initialize() {
$sents =$_GET["ftext"];
google.language.translate($sents, "en", "he", function(result) {
if (!result.error) {
var container = document.getElementById("translation");
container.innerHTML = result.translation;
}
});
}
google.setOnLoadCallback(initialize);
</script>
</head>
<body>
<div id="translation"></div>
</body>
</html>
i have a var that i want to translate (is name is ftext) i am using the GET method to catch it from other web page, the problem is that i dont know how to catch it and use it in the initialize function. what i am doing wrong?
this is the web page i getting the text from
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>MY-Site</title>
</head>
<body>
<form method=get action=new1.html accept-charset=utf8>
<textarea name=ftext cols=12 rows=3 dir=ltr>
</textarea><br>
<input type=submit value=send>
</form>
</body>
</html>