Add a javascript file in Magento 1.9












0















I'm discovering magento since 1 week. But i have a problem now.
I need to include a javascript file in my admin panel to sort a list according to another.
I'm using magento 1.9 and i really don't find any tutorial to do this.



Please can someone explain me clearly how to do this because i'm really stuck at this point.










share|improve this question














bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Do you want to add the js globally to your backend or just to a specifiv grid view? Are you using a module or just altering core files?

    – Yiorgos Moschovitis
    May 27 '16 at 10:05











  • "(Ok, my message has been deleted, i don't know why...)" - because it is not an answer. Stack Exchange does not work like a forum. If you want to add details, edit the question. Only post an answer if you have a solution.

    – Fabian Schmengler
    May 27 '16 at 15:43
















0















I'm discovering magento since 1 week. But i have a problem now.
I need to include a javascript file in my admin panel to sort a list according to another.
I'm using magento 1.9 and i really don't find any tutorial to do this.



Please can someone explain me clearly how to do this because i'm really stuck at this point.










share|improve this question














bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Do you want to add the js globally to your backend or just to a specifiv grid view? Are you using a module or just altering core files?

    – Yiorgos Moschovitis
    May 27 '16 at 10:05











  • "(Ok, my message has been deleted, i don't know why...)" - because it is not an answer. Stack Exchange does not work like a forum. If you want to add details, edit the question. Only post an answer if you have a solution.

    – Fabian Schmengler
    May 27 '16 at 15:43














0












0








0








I'm discovering magento since 1 week. But i have a problem now.
I need to include a javascript file in my admin panel to sort a list according to another.
I'm using magento 1.9 and i really don't find any tutorial to do this.



Please can someone explain me clearly how to do this because i'm really stuck at this point.










share|improve this question














I'm discovering magento since 1 week. But i have a problem now.
I need to include a javascript file in my admin panel to sort a list according to another.
I'm using magento 1.9 and i really don't find any tutorial to do this.



Please can someone explain me clearly how to do this because i'm really stuck at this point.







magento-1.9 php admin javascript






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 27 '16 at 9:39









NitchoulasNitchoulas

1




1





bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 11 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Do you want to add the js globally to your backend or just to a specifiv grid view? Are you using a module or just altering core files?

    – Yiorgos Moschovitis
    May 27 '16 at 10:05











  • "(Ok, my message has been deleted, i don't know why...)" - because it is not an answer. Stack Exchange does not work like a forum. If you want to add details, edit the question. Only post an answer if you have a solution.

    – Fabian Schmengler
    May 27 '16 at 15:43



















  • Do you want to add the js globally to your backend or just to a specifiv grid view? Are you using a module or just altering core files?

    – Yiorgos Moschovitis
    May 27 '16 at 10:05











  • "(Ok, my message has been deleted, i don't know why...)" - because it is not an answer. Stack Exchange does not work like a forum. If you want to add details, edit the question. Only post an answer if you have a solution.

    – Fabian Schmengler
    May 27 '16 at 15:43

















Do you want to add the js globally to your backend or just to a specifiv grid view? Are you using a module or just altering core files?

– Yiorgos Moschovitis
May 27 '16 at 10:05





Do you want to add the js globally to your backend or just to a specifiv grid view? Are you using a module or just altering core files?

– Yiorgos Moschovitis
May 27 '16 at 10:05













"(Ok, my message has been deleted, i don't know why...)" - because it is not an answer. Stack Exchange does not work like a forum. If you want to add details, edit the question. Only post an answer if you have a solution.

– Fabian Schmengler
May 27 '16 at 15:43





"(Ok, my message has been deleted, i don't know why...)" - because it is not an answer. Stack Exchange does not work like a forum. If you want to add details, edit the question. Only post an answer if you have a solution.

– Fabian Schmengler
May 27 '16 at 15:43










2 Answers
2






active

oldest

votes


















0














First you have to choose a relevant layout(.xml) file based on the grid/page you want to include your javascript in.



Then in that layout you need to add the below code in the relevant section:



<layout>
<adminhtml_{relevant_layout_handle}>
<reference name="head">
<action method="addJs"><script>my_extension/adminhack.js</script></action>
<action method="addJs"><script>prototype/prototype.js</script></action>
</reference>
</adminhtml_{relevant_layout_handle}>
</layout>


Then you need to clear Magento caches and check if your file is loaded or not.



Hope this works for you






share|improve this answer































    0














    First you have to create one module and with in module's layout file you can add a javascript and css using above answer syntax.






    share|improve this answer






















      protected by Community May 27 '16 at 16:52



      Thank you for your interest in this question.
      Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



      Would you like to answer one of these unanswered questions instead?














      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      First you have to choose a relevant layout(.xml) file based on the grid/page you want to include your javascript in.



      Then in that layout you need to add the below code in the relevant section:



      <layout>
      <adminhtml_{relevant_layout_handle}>
      <reference name="head">
      <action method="addJs"><script>my_extension/adminhack.js</script></action>
      <action method="addJs"><script>prototype/prototype.js</script></action>
      </reference>
      </adminhtml_{relevant_layout_handle}>
      </layout>


      Then you need to clear Magento caches and check if your file is loaded or not.



      Hope this works for you






      share|improve this answer




























        0














        First you have to choose a relevant layout(.xml) file based on the grid/page you want to include your javascript in.



        Then in that layout you need to add the below code in the relevant section:



        <layout>
        <adminhtml_{relevant_layout_handle}>
        <reference name="head">
        <action method="addJs"><script>my_extension/adminhack.js</script></action>
        <action method="addJs"><script>prototype/prototype.js</script></action>
        </reference>
        </adminhtml_{relevant_layout_handle}>
        </layout>


        Then you need to clear Magento caches and check if your file is loaded or not.



        Hope this works for you






        share|improve this answer


























          0












          0








          0







          First you have to choose a relevant layout(.xml) file based on the grid/page you want to include your javascript in.



          Then in that layout you need to add the below code in the relevant section:



          <layout>
          <adminhtml_{relevant_layout_handle}>
          <reference name="head">
          <action method="addJs"><script>my_extension/adminhack.js</script></action>
          <action method="addJs"><script>prototype/prototype.js</script></action>
          </reference>
          </adminhtml_{relevant_layout_handle}>
          </layout>


          Then you need to clear Magento caches and check if your file is loaded or not.



          Hope this works for you






          share|improve this answer













          First you have to choose a relevant layout(.xml) file based on the grid/page you want to include your javascript in.



          Then in that layout you need to add the below code in the relevant section:



          <layout>
          <adminhtml_{relevant_layout_handle}>
          <reference name="head">
          <action method="addJs"><script>my_extension/adminhack.js</script></action>
          <action method="addJs"><script>prototype/prototype.js</script></action>
          </reference>
          </adminhtml_{relevant_layout_handle}>
          </layout>


          Then you need to clear Magento caches and check if your file is loaded or not.



          Hope this works for you







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 27 '16 at 10:28









          Vicky DevVicky Dev

          1,27761539




          1,27761539

























              0














              First you have to create one module and with in module's layout file you can add a javascript and css using above answer syntax.






              share|improve this answer




























                0














                First you have to create one module and with in module's layout file you can add a javascript and css using above answer syntax.






                share|improve this answer


























                  0












                  0








                  0







                  First you have to create one module and with in module's layout file you can add a javascript and css using above answer syntax.






                  share|improve this answer













                  First you have to create one module and with in module's layout file you can add a javascript and css using above answer syntax.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 27 '16 at 10:35









                  Murtuza ZabuawalaMurtuza Zabuawala

                  12.5k73362




                  12.5k73362

















                      protected by Community May 27 '16 at 16:52



                      Thank you for your interest in this question.
                      Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                      Would you like to answer one of these unanswered questions instead?



                      Popular posts from this blog

                      Alcázar de San Juan

                      Griza ansero

                      Heinkel He 51