The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> JavaScript Development
|
External javascript files and AOL??
Discuss External javascript files and AOL?? in the JavaScript Development forum on Dev Shed. External javascript files and AOL?? JavaScript Development forum discussing JavaScript and DHTML, AJAX, and issues such as coding cross-browser JavaScript.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 5th, 2001, 10:03 AM
|
|
ÐÊšîGñË®
|
|
Join Date: Apr 2001
Posts: 66
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
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
|

December 5th, 2001, 12:51 PM
|
|
|
|
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.
|

December 5th, 2001, 01:19 PM
|
|
ÐÊšîGñË®
|
|
Join Date: Apr 2001
Posts: 66
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
I checked on Netscape 4.74 and got no errors. hmm..
I hate this compatability crap
|

December 5th, 2001, 04:40 PM
|
|
ÐÊšîGñË®
|
|
Join Date: Apr 2001
Posts: 66
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
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?
|

December 5th, 2001, 05:32 PM
|
|
Do you like PHP like ME?
|
|
Join Date: Nov 2001
Location: St. George, Utah, of the USA
Posts: 67
Time spent in forums: < 1 sec
Reputation Power: 12
|
|
|
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.
|

December 5th, 2001, 06:32 PM
|
|
ÐÊšîGñË®
|
|
Join Date: Apr 2001
Posts: 66
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
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;
}
}
|

December 6th, 2001, 08:28 AM
|
|
ÐÊšîGñË®
|
|
Join Date: Apr 2001
Posts: 66
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
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.
|

December 6th, 2001, 08:56 AM
|
|
ÐÊšîGñË®
|
|
Join Date: Apr 2001
Posts: 66
Time spent in forums: < 1 sec
Reputation Power: 13
|
|
|
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.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|