Page 2 of 2

Re: jquery problems

Posted: Sat Oct 09, 2010 11:53 am
by John Cartwright
At some point I'm going to just ask you to fix your own parse error :D.

As before, you do not wrap this code in a function. Please refer to jquery for some examples on attaching "events", otherwise javascript callbacks.

Re: jquery problems

Posted: Sat Oct 09, 2010 6:08 pm
by scifirocket
i am comparing this from the jquery documentation:
[text]<script>
$("select").change(function () {
var str = "";
$("select option:selected").each(function () {
str += $(this).text() + " ";
});
$("div").text(str);
})
.change();
</script>
[/text]

to my code:
[text]<script>

$(document).ready() {
$("searchb").change(function () {
$.post("searchtest.php", {partialName: $(this).val()},function(data) {
$("#results").html(data);
});
});
});

</script>
[/text]

beside the face that i'm still getting the same error as before, it looks like I need to call the .change() method at the end. is this correct?