#1
  1. No Profile Picture
    ʚGˮ
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    66
    Rep Power
    14

    External javascript files and AOL??


    Does AOL have a problem with external javascript files?

    I put up a demo site for a prospective client and they reported errors through AOL's browser, but it worked in IE.

    The site is Here...

    If anyone else finds they are getting line errors, please tell me browser and version if you will.

    BTW I HATE AOL
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2001
    Posts
    1,882
    Rep Power
    20
    I get errors using NS4.7
    The Mouseovers on the buttons work, so it must be one of your other functions.

    NS6 and IE6 are fine.
  4. #3
  5. No Profile Picture
    ʚGˮ
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    66
    Rep Power
    14
    I checked on Netscape 4.74 and got no errors. hmm..

    I hate this compatability crap
  6. #4
  7. No Profile Picture
    ʚGˮ
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    66
    Rep Power
    14
    OK I think I have a handle on what the problem is, but I am not sure what to do about it. It works fine in IE 5.5 but not in IE 5.0

    The script runs a function to set the button which links to the current page to the down image after checking the current URL and doing a regular expression string comparison. In earlier browser versions, it is not finding the image object when it runs this function. It does not run the function until after the page has loaded the images. Why it is not finding the objects is a mystery to me. If you click on of the text links to another page, the script runs just fine, as does all subsequent link clicks.

    Anyone have any ideas on fixing this or know someone else running a similar script?
  8. #5
  9. No Profile Picture
    Do you like PHP like ME?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    St. George, Utah, of the USA
    Posts
    67
    Rep Power
    14
    I use ie mainly but I have aol and the mouseover isn't working. used to have aprogram that did it for me but I lost it seeing I haven't used it forever thanks to css...and either my internet's slow or your site is really bulky. It took forever to view. I would change mouseover scripts to something more crosscomptable. Otherwise ur really minimizing ur audience.
    You know your a web programmer when you see a '$' and think of PHP rather than money.
  10. #6
  11. No Profile Picture
    ʚGˮ
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    66
    Rep Power
    14
    Hopefull I found the problem. For some reason, I had document.location.href instead of window.location.href ... oops.

    Can I get some testers to let me know if it is still a problem?

    The host that I use for my own is sometimes slow. I just have the demo up for testing purposes. Maybe when I am making real money doing web design, I will get a better host. All the images are under 6k... most under 2k with the exception of the property images. (the slowness could be AOL too).

    Here are the functions:

    Code:
    function checkPage() {
    	if (document.images) {
    		var activePage = ""
    		var activeURL = ""
    		var pageName = window.location.href
    		reRoot = new RegExp (/\W$/)
    		reIndex = new RegExp ("index.html")
    		reListings = new RegExp ("listings.html")
    		reAgents = new RegExp ("agents.html")
    		reCompany = new RegExp ("company.html")
    		reLinks = new RegExp ("links.html")
    	
    	if (reRoot.test(pageName)) {
    		activePage = "index";
    		activeURL = "images/" + activePage + "-over.jpg";
    		}
    	if (reIndex.test(pageName)) {
    		activePage = "index";
    		activeURL = "images/" + activePage + "-over.jpg";
    		}
    	if (reListings.test(pageName)) {
    		activePage = "listings";
    		activeURL = "images/" + activePage + "-over.jpg";
    		}
    	if (reAgents.test(pageName)) {
    		activePage = "agents";
    		activeURL = "images/" + activePage + "-over.jpg";
    		}
    	if (reCompany.test(pageName)) {
    		activePage = "company";
    		activeURL = "images/" + activePage + "-over.jpg";
    		}
    	if (reLinks.test(pageName)) {
    		activePage = "links";
    		activeURL = "images/" + activePage + "-over.jpg";
    		}
    	document[activePage].src = activeURL;
    	}
    }
    
    function switchOver(btn) {
    	if (document.images) {
    		var activePage = ""
    		var activeURL = ""
    		var pageName = window.location.href
    		reRoot = new RegExp (/\W$/)
    		reIndex = new RegExp ("index.html")
    		reListings = new RegExp ("listings.html")
    		reAgents = new RegExp ("agents.html")
    		reCompany = new RegExp ("company.html")
    		reLinks = new RegExp ("links.html")
    		
    		if (reRoot.test(pageName)) {
    			activePage = "index";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reIndex.test(pageName)) {
    			activePage = "index";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reListings.test(pageName)) {
    			activePage = "listings";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reAgents.test(pageName)) {
    			activePage = "agents";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reCompany.test(pageName)) {
    			activePage = "company";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reLinks.test(pageName)) {
    			activePage = "links";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (btn == activePage) {
    			document[btn].src = activeURL;
    			}
    		else {
    			imgFile = "images/" + btn + "-over.jpg";
    			document[btn].src = imgFile;
    			imgActive = "images/" + activePage + ".jpg";
    			document[activePage].src = imgActive;
    			}
    		}
    	}
    	
    function switchOut(btn) {
    	if (document.images) {
    		var activePage = ""
    		var activeURL = ""
    		var pageName = window.location.href
    		reRoot = new RegExp (/\W$/)
    		reIndex = new RegExp ("index.html")
    		reListings = new RegExp ("listings.html")
    		reAgents = new RegExp ("agents.html")
    		reCompany = new RegExp ("company.html")
    		reLinks = new RegExp ("links.html")
    		
    		if (reRoot.test(pageName)) {
    			activePage = "index";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reIndex.test(pageName)) {
    			activePage = "index";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reListings.test(pageName)) {
    			activePage = "listings";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reAgents.test(pageName)) {
    			activePage = "agents";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reCompany.test(pageName)) {
    			activePage = "company";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		if (reLinks.test(pageName)) {
    			activePage = "links";
    			activeURL = "images/" + activePage + "-over.jpg";
    			}
    		imgFile = "images/" + btn + ".jpg";
    		document[btn].src = imgFile;
    		document[activePage].src = activeURL;
    		}
    	}
  12. #7
  13. No Profile Picture
    ʚGˮ
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    66
    Rep Power
    14
    I think I have pinpointed the problem. When you first go to the site, the URL is http://pinnacledesigns.tv/mcweb/ and at the bottom of the index.html page is a script that writes 4 things:

    the value of activePage from the function checkPage()
    the value of activeURL from the function checkPage()
    the value of window.location.href
    the value of document.URL

    If you load any URL by specifying the html page, you get no errors and http://pinnacledesigns.tv/mcweb/index.html returns all values. http://pinnacledesigns.tv/mcweb/ does not return any values. The function checkPage() relies on a returned URL to set the button state. That is where the error occurs.

    In checkPage(), the variable
    Code:
    reRoot = new RegExp (/\W$/)
    is supposed to set the value as a regular expression of a non-character at the end of the string and

    Code:
    if (reRoot.test(pageName)) {
    	activePage = "index";
    	activeURL = "images/" + activePage + "-over.jpg";
    	}
    is supposed to compare the URL to the regular expression. It works with IE 5.5 but not earlier versions. I am trying to find a work around but have not found anything yet. If someone has any other ideas, please let me know.
  14. #8
  15. No Profile Picture
    ʚGˮ
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2001
    Posts
    66
    Rep Power
    14
    Well it looks like I have no choice but to use a redirect to solve it. If anyone has any other solutiuons I'd like to hear them, but for now, this will work.

IMN logo majestic logo threadwatch logo seochat tools logo