Not sure if this should be in the Client or server side… but I’ll try here becuase I think it’s more of a JS issue.
I have a function that makes an AJAX call and I set up the filename as:
var LOGIN_PREFIX = ‘login.php?’;
However, this is where I am getting lost. My directory structure is something like:
root dir
- index.php
- login.php
> js dir
> - functions.js
I include js/functions.js in my index.php, and now I want my functions.js to call login.php to do this AJAX work… however, if I leave my prefix as is, it doesn’t appear that the call is being made (nothing comes back at all).
I have tried
var LOGIN_PREFIX = ‘…/login.php?’;
but get no results…
Any ideas?
Thanks!
–d
EDIT:
The error appears to be in my method I have
function addEvent(objObject, strEventName, fnHandler) {
// DOM-compliant way to add an event listener
if (objObject.addEventListener) {
objObject.addEventListener(strEventName, fnHandler, false);
}
// IE/windows way to add an event listener
else if (objObject.attachEvent) {
objObject.attachEvent(‘on’ + strEventName, fnHandler);
}
}
and I call it in here
function setupLogin()
{
validate = document.getElementById(‘validate’);
addEvent(validate, ‘click’, validateLogin);
}
after
addEvent(window,‘load’,setupLogin);
So the problem appears to be in handling the click event… I am working on it now… so… forget my issue…