How to add an external javascript or css file to magento?
Answer Posted / Lakhpat Ram
To include an external JavaScript or CSS file in Magento, you can use the following methods:n1. Using layout XML files: Add a reference to the script/stylesheet in the appropriate layout handle. For example, for CSS files, add it inside `<head>` tags within your theme's `local.xml` or `page_html.xml`. For JavaScript files, use `<action method="insertPhtmlBeforeBodyEnd">`.n2. Directly in your pHTML file: Add the script tag to your custom pHTML file.nFor example for CSS:n```n<link rel="stylesheet" type="text/css" href="your_url.css">n```nFor JavaScript:n```n<script src="your_url.js"></script>n```
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers