javascript - How to start using yoda speak web service -
i web programming beginner programming knowledge level cannot handle problem , googled lot still no result. using yoda speak api http://www.yodaspeak.co.uk/webservice/yodatalk.php?wsdl
it xml file. xml file documentation file? how can set text box , button call program? wrote codes not work.
html:
<p><h1>here converter changing sentences yoda's style</h1></p> <input type="text" id="input"> <button class="button" onclick="convert()">convert</button>
javascript:
function convert(){ var input = document.getelementbyid('input').value; }
and sorry not know how continue. sorry.
have checked ws.js. more info @
http://www.ibm.com/developerworks/webservices/library/ws-wsajax/
you may better off using rest style api's such this,
http://funtranslations.com/api/yoda
since integrating javascript easy. here functional example using funtranslations yoda api.
$('#but').click( function() { var input = document.getelementbyid('input').value; $.getjson("//api.funtranslations.com/translate/yoda.json?text=" + input, function( data ) { $('#result').append(data.contents.translated); }); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <h1>here converter changing sentences yoda's style</h1> <input type="text" id="input" value="master obiwan has lost planet"> <div> converted text : <span id="result"></span></div> <button class="button" id="but">convert</button>
Comments
Post a Comment