Forums / General Questions / strange Javascript behaviour

strange Javascript behaviour

Started by skylab001 on 14 Feb 2012, 6:08 PM · Views: 842

Results 1 to 2 of 2
14 Feb 2012, 6:08 PM
#1
skylab001 avatar

skylab001

New Zenner

Join Date:
Jan 2008
Posts:
67
Plugin Contributions:
0

strange Javascript behaviour

I'm finding that the loading of javascript .js files can sometimes be hit or miss. I have had a few .js files that have not functioned properly when using the jscript_{filename}.js naming convention, but when the exact same script is hard coded into the html_header.php, it works just fine? In both instances the script loads into the document, but the .js files can be hit or miss as far as functionality. I'm sure there could be user error involved, but it seems strange when the .js file is copied and pasted to the html_header.php file it works perfect.

Any ideas why this would be happening or has anybody experienced this?

Will hard coding the scripts cause any issues, other than upgrade hassles? I would much rather sort this out and be using the .js files.

23 Feb 2012, 4:14 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: strange Javascript behaviour

If the files are placed in the prescribed folders and named appropriately, I don't see why they would be "hit or miss" about getting output to the browser properly.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.