ajax - Why does when i call the .php file, the jquery function of it doesnt work

57 views Asked by At

I have this in my <head>

<link rel="stylesheet" href="css/jquery-ui.css" />
<script src="js/jquery.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="js/date.js"></script>

all of it is vital to run the date time picker which is this.

<span><input id="datepicker" style="width:64px;outline:none;border:transparent;" type="text" > </span>

Yeah sure thing, it works. but whenever i am calling the whole .php of it and it display to the page. it doesnt work. here is my ajax code.

  <script type="text/javascript">
function get_bookextt(user_id) {
     var request = $.ajax({
                         url: "getbookext.php",
                         type: "POST",
                         data: {'user_id': user_id},
                         dataType: "html"
                    });
     request.done(function(msg) {
          $("#get_bookext").html(msg);            
     });
     request.fail(function(jqXHR, textStatus) {
          alert( "Request failed: " + textStatus );
     });
}
</script>

So i will recap my question in case i didnt explain it very well. that getbookext.php is working just fine, but whenever i am calling it from another page, the date time picker doesnt work anymore.

EDITED: The page i am calling it from also have the seam <head> could it be the problem?

0

There are 0 answers