jQuery Mobile - android/safari crash on submit
Hi all this is my first post.
The problem im having is with a simple script i made a year back and now trying to get working on mobile.
It's basicaly getting twitter feeds and displaying the amount of feeds you want per person.
the problem is, when clicking on the username input box and then typing the username, it will crash if you press the `green enter button` ( for those on android, latest version, HTC Desire ). It will not crash if you simply hide the keyboard and then go to the submit button.
Can anyone shine any light on this?
jq:
- <script type="text/javascript">
$(document).ready(function () {
try{
$("#getFeed").bind("click", function () {
var b = $("#twitterName").val();
var c = $("#twitterPosts :selected").text();
if (b != "") {
$("#twitterResult").html('<p>Feeding the birds... <img src="./images/for_web/loader.gif" width="16" height="16" /></p>');
$.ajax({
type: "POST",
url: './php/php.php',
data: 'user=' + b + '&mob=true&posts=' + c,
cache: false,
error: function () {
$("#twitterResult").html("<p>An internal error occured, please try again later.</p>")
},
success: function (a) {
$("#twitterResult").html(a)
}
})
} else {
$("#twitterResult").html("<p>Please enter your Twitter username.</p>")
}
})
}catch(err){
alert(err.description);
}
});
</script>
form:
- <form action="#" id="birdFeeder">
<p><input type="text" name="twitterName" id="twitterName" value="Username..." /><select id="twitterPosts"><option>1</option><option>2</option><option>3</option><option>4</option><option>5</option></select><input type="button" name="getFeed" id="getFeed" value="Feed Me!" /></p>
</form>
<div id="twitterResult"></div>