As before, you do not wrap this code in a function. Please refer to jquery for some examples on attaching "events", otherwise javascript callbacks.
jquery problems
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: jquery problems
At some point I'm going to just ask you to fix your own parse error
.
As before, you do not wrap this code in a function. Please refer to jquery for some examples on attaching "events", otherwise javascript callbacks.
As before, you do not wrap this code in a function. Please refer to jquery for some examples on attaching "events", otherwise javascript callbacks.
-
scifirocket
- Forum Commoner
- Posts: 31
- Joined: Fri Aug 13, 2010 1:24 am
Re: jquery problems
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?
[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?