3

I had seen 'js' folders inside my different theme folders, but what is the purpose of 'js' folder inside the root directory of magento ?

enter image description here

while navigating through the folder i found an index file inside it. curiosly When i just entered the url in my browser :

localhost/gk/js

i got this output in my browser

SYNTAX: index.php/x.js?f=dir1/file1.js,dir2/file2.js

this string is also visible in my live store, does this string provide any clues to hackers? im not a magento expert, Expecting more advises from experts.

6

The js folder contain js files that don't depend on the theme you are working on.
You will find here the prototype framework, some form validation files, some backend general files and other.

The other files that are theme dependend should be placed in skin/frontend/{package}/{theme}.

And you don't need to worry about the message you see

 SYNTAX: index.php/x.js?f=dir1/file1.js,dir2/file2.js

This is generated by the first lines of the js/index.php file

if (empty($_GET['f'])) {
    header('HTTP/1.0 404 Not Found');
    echo "SYNTAX: index.php/x.js?f=dir1/file1.js,dir2/file2.js";
    exit;
} 

The index.php file from this folder, allows you to merge some js files when requested from the server for speed purposes.

  • i was little bit worried about "SYNTAX: index.php/x.js?f=dir1/file1.js,dir2/file2.js"; Output.Thanks for ur answer !! <3 – Shan Jun 29 '15 at 15:37
  • when the /js/index.php is actually used ? – Fra Mar 22 '17 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.