hookedupphat
11-21-2009, 07:33 PM
Hi, i'm really hoping someone can help me, I'm new to jquery so i'd really appreciate it. (I've tried searching google and the forum, but i'm not sure what to search for)
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
<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?
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
<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?