Jump to content

calast

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

calast's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK, we'll skip over the vaguely insulting tone, and just take the opportunity to point out that I understand completely where PHP runs. I make my living writing Ajax code. It does not change the fact the problem can only be observed when the browser in use is IE. Also, there is a reason that the code is written to version 4 standards. I have no control over the server environment, and it has to run under PHP 4. When you do this for a living, you work in the environment your employer specifies. Such is life.
  2. I ran into an interesting problem when doing a customer demo today (worst possible time) that I traced to an IE-specific behavior. I've coded around this but am interested in knowing if others have run into this, and if there's an obvious workaround, because I really liked this code... Assume that there is a class called Facility, stripped down to this: class Facility { var $id; var $Latitude; var $Longitude; // and some other properties... function Facility($id) { $this->id = $id; } function ReadFromDB($rec) { // read a record from the database, filing in all properties for this object from the specified record } function GetLatitude() { return $this->Latitude; } function GetLongitude() { return $this->Longitude; } } Note that I just typed this in, and please believe any typos I make here are not in the original code. Now, there is another class called Dispatch, which also has latitude and longitude information, which I wish to copy from the facility. class Dispatch() { $latitude; $longitude; $facility; // various other properties function SetLatLon() { // from the facility $f = new Facility(0); $f->ReadFromDB($this->facility); $this->latitude = $f->GetLatitude(); $this->longitude = $f->GetLongitude(); } } Now this works fine in Firefox - I have not yet tested in Safari and Opera. But in IE, it complains that $f->getlatitude is not defined. Note that the error message has mapped the call to all lower case, which might be OK - but it doesn't work. Note also that it didn't complain about the constructor or the ReadFromDB method - just GetLatitude. So it seems clear that it isn't a problem with finding the class file - require_once('facility.php') - since if it couldn't find that file, it could not have found the other methods either. This behavior is observed on different hosts running different versions of PHP, and I have looked directly at the included class definition to ensure that I didn't have some old version that was missing those methods. Besides which, it works OK in Firefox, just not in IE. Anyone have an idea as to what is going on here? Not a showstopper, since I fixed it by retrieving the info from outside the class, but if this really is an IE limitation, I'd like to not make this mistake again. Thanks for any suggestions. -Ken
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.