I have a page and defined my java script functions in a custom.js file ( I'm using jQuery ).
I put JS file at end of body before </body> tag
My page have a div element like this:<div id="userinfo"></div>
when my page load, my JS file fetch an external page to that.
external page have a element like this<div id="login"></div>
in my JS file, I defined a function that when user clicked the login a modal window load an show the login form to the user.
but when i load the external page, my JS file does not work!! it seems that can't find the element.
guide me Please! :)
Some part of custom.js file:
jQuery(document).ready(function($) {
$('#userinfo').load('CustomerOptions.asp');
(function() {
$('#login').click(function(event){
// something to do
});
})();
});