I need to do a predefined Google Search through a javascript function, launched by a button in the page.
So I have tryed before with no sucess:
<html>
<head>
<script language="JavaScript">
function googleSearch(quest){
var googlefind = "http://www.google.com/search?hl=en&q=" + quest + " buy Blu-Ray DVD";
window.open(googlefind);
}
</script>
</head>
<body>
<INPUT type="button" value="Buy this Anime Now!" onclick="googleSearch("Fullmetal Alchemist Brotherhood");">
</body>
</html>
Does somebody can help me please?
Added
escape()togooglefindin your function, and changed the keywords to be in single quotes in youronclick.