hookedupphat
11-21-2009, 06:41 PM
I posted this in the ajax forum, I think it belongs here...sorry :o
I could really use some help, I'm new to jQuery
Basically I have a calendar with a link to go to the next or previous day. What i have below works once, but once the ajax page loads it stops working.
<script language="javascript">
$(document).ready(function() {
$.ajaxSetup ({
cache: false
});
var ajax_load = "<img src='images/ajax.gif' alt='loading...' />";
// load() functions
var loadUrl = "includes/cal.php";
$("#load").click(function(){
$("#cal_content").html(ajax_load).load(loadUrl, { 'option': ["tom"] } );
});
});
</script>
<div id="cal_content">
<a href="#" id="load">Next</a>
</div>
// includes/cal.php
<div id="cal_content">
<? if($_POST['option']...blah blah blah ?>
<a href="#" id="load">Next</a>
</div>
Obviously there's a lot more code in these files I did not include, but that's what you need to know. It is loading cal.php into the dom just fine, but once it's in there, it doesn't work. I've tried using class instead of id values, but it does the same thing.
Can anyone help me please?
I could really use some help, I'm new to jQuery
Basically I have a calendar with a link to go to the next or previous day. What i have below works once, but once the ajax page loads it stops working.
<script language="javascript">
$(document).ready(function() {
$.ajaxSetup ({
cache: false
});
var ajax_load = "<img src='images/ajax.gif' alt='loading...' />";
// load() functions
var loadUrl = "includes/cal.php";
$("#load").click(function(){
$("#cal_content").html(ajax_load).load(loadUrl, { 'option': ["tom"] } );
});
});
</script>
<div id="cal_content">
<a href="#" id="load">Next</a>
</div>
// includes/cal.php
<div id="cal_content">
<? if($_POST['option']...blah blah blah ?>
<a href="#" id="load">Next</a>
</div>
Obviously there's a lot more code in these files I did not include, but that's what you need to know. It is loading cal.php into the dom just fine, but once it's in there, it doesn't work. I've tried using class instead of id values, but it does the same thing.
Can anyone help me please?