Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8664405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:13:59+00:00 2026-06-12T17:13:59+00:00

I am trying to load a js file through XML on the dashboard page

  • 0

I am trying to load a js file through XML on the dashboard page of magento admin, but am unable to get it right.

Here is the part of code that I have added in my config file:

<config>
    <adminhtml>
        <layout>
            <updates>
                <anattadesign_abandonedcarts>
                    <file>my_extension.xml</file>
                </anattadesign_abandonedcarts>
            </updates>
        </layout>
    </adminhtml>
</config>

And my contents of my_extension.xml which is placed under /app/design/adminhtml/default/default/layout/ is:

<layout>
    <default>
        <reference name="head">
            <action method="addJs"><script>my_extension/adminhack.js</script></action>
            <action method="addJs"><script>prototype/prototype.js</script></action>         
        </reference>
    </default>
</layout>

I understand that I am trying to load a js file for the whole admin this way, but I would like to know both, loading on a certain page, and how to find out the name if I want to load it on a certain page and if default is the correct one to make it load on all admin pages.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:14:01+00:00Added an answer on June 12, 2026 at 5:14 pm

    Using default should load it on all pages, indeed.

    To load it on just admin dashboard use the (full 3 element) route with underscores as separators to the page. For the dashboard this is Adminhtml/(controllers)/Dashboard(Controller)/index(Action).

    <layout>
      <adminhtml_dashboard_index>
        <reference name="head">
                <action method="addJs"><script>my_extension/adminhack.js</script></action>
                <action method="addJs"><script>prototype/prototype.js</script></action>         
            </reference>
      </adminhtml_dashboard_index>
    </layout>
    

    N.B. I have not tested this code, but I think it should do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to load an XML file that asks for a username and
I'm trying to load an XML file with a list of books, I looked
I have an XML file containing seed data that I'm trying to load into
Greetings I'm trying to get an xml file from a website which requires me
I'm trying to load an XML file from a separate project; One of these
i am trying to load an xml file to php in order to display
Im trying to load content into a DIV from an XML file when the
I'm trying to load XML data into a SQL Server table. The XML file
I get an error when trying to update an XML file with asXML(). The
I'm trying to open/load an XML file specified in an Excel worksheet in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.