Magento 2 adding jquery in home pageJquery Conflict Issue Magento 1.9jQuery conflict in the product view pageAdding a jQuery Library to Magento 2CSS Not Reflecting in Magento 2using jQuery-ui accordion in checkout pagePass jQuery value to Observer in Magento 2Magento 2 : Mini-cart quantity update button not working properlyDisplay Remove and Edit Item button in Order summary in Onepage Checkout page Magento2add custom js to the certain input element on the checkout pageAdding link to the Checkout button in magento2

How to hook up Korg EX-8000 to a computer w/o a keyboard?

Book in which the "mountain" in the distance was a hole in the flat world

P-adic functions on annuli

Why didn't NASA launch communications relay satellites for the Apollo missions?

Is it ethical to tell my teaching assistant that I like him?

Find position equal columns of matrix

Inside Out and Back to Front

Install suspension forks on non-suspension bike

Remove side menu(right side) from finder

How far off did Apollo 11 land?

Difference between string += s1 and string = string + s1

How deep is the Underdark? What is its max and median depth?

Trivial non-dark twist in dark fantasy

Router restarts after big git push or big file upload

Aren't all schwa sounds literally /ø/?

Why does airflow separate from the wing during stall?

Why would word of Princess Leia's capture generate sympathy for the Rebellion in the Senate?

Brute-force the switchboard

Three phase systems - are there any single phase devices that are connected between two phases instead of between one phase and neutral?

A Real World Example for Divide and Conquer Method

Can anyone help me to adjust the following asterisks?

How can electronics on board JWST survive the low operating temperature while it's difficult to survive lunar nights?

ESTA Travel not Authorized. Accepted twice before!

Date input format problem



Magento 2 adding jquery in home page


Jquery Conflict Issue Magento 1.9jQuery conflict in the product view pageAdding a jQuery Library to Magento 2CSS Not Reflecting in Magento 2using jQuery-ui accordion in checkout pagePass jQuery value to Observer in Magento 2Magento 2 : Mini-cart quantity update button not working properlyDisplay Remove and Edit Item button in Order summary in Onepage Checkout page Magento2add custom js to the certain input element on the checkout pageAdding link to the Checkout button in magento2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I have added 'jquery-1.10.2.min.js' in appcodeVendorModuleviewfrontendwebjsdefault.xml file for showing a pop up on clicking Add to Wishlist button for product in home page. But on including custom js, the default 'Add to Cart' , 'Remove Item' is not working in My Wishlist section. Is it possible to include js file only for home page by removing the file default.xml



The following is my default.xml file.



<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<script src="vendor_Module::js/jquery-1.10.2.min.js"/>

<script src="vendor_Module::js/jquery.easing-1.3.pack.js"/>
<script src="vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<script src="vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>









share|improve this question

















  • 1





    you have to use inside cms_index_index.xml file

    – Rakesh Jesadiya
    Dec 12 '16 at 6:25











  • Use link instead of script tag in declaration.

    – Rakesh Jesadiya
    Dec 12 '16 at 6:29

















2















I have added 'jquery-1.10.2.min.js' in appcodeVendorModuleviewfrontendwebjsdefault.xml file for showing a pop up on clicking Add to Wishlist button for product in home page. But on including custom js, the default 'Add to Cart' , 'Remove Item' is not working in My Wishlist section. Is it possible to include js file only for home page by removing the file default.xml



The following is my default.xml file.



<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<script src="vendor_Module::js/jquery-1.10.2.min.js"/>

<script src="vendor_Module::js/jquery.easing-1.3.pack.js"/>
<script src="vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<script src="vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>









share|improve this question

















  • 1





    you have to use inside cms_index_index.xml file

    – Rakesh Jesadiya
    Dec 12 '16 at 6:25











  • Use link instead of script tag in declaration.

    – Rakesh Jesadiya
    Dec 12 '16 at 6:29













2












2








2


1






I have added 'jquery-1.10.2.min.js' in appcodeVendorModuleviewfrontendwebjsdefault.xml file for showing a pop up on clicking Add to Wishlist button for product in home page. But on including custom js, the default 'Add to Cart' , 'Remove Item' is not working in My Wishlist section. Is it possible to include js file only for home page by removing the file default.xml



The following is my default.xml file.



<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<script src="vendor_Module::js/jquery-1.10.2.min.js"/>

<script src="vendor_Module::js/jquery.easing-1.3.pack.js"/>
<script src="vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<script src="vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>









share|improve this question














I have added 'jquery-1.10.2.min.js' in appcodeVendorModuleviewfrontendwebjsdefault.xml file for showing a pop up on clicking Add to Wishlist button for product in home page. But on including custom js, the default 'Add to Cart' , 'Remove Item' is not working in My Wishlist section. Is it possible to include js file only for home page by removing the file default.xml



The following is my default.xml file.



<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<script src="vendor_Module::js/jquery-1.10.2.min.js"/>

<script src="vendor_Module::js/jquery.easing-1.3.pack.js"/>
<script src="vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<script src="vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>






magento2 jquery






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 12 '16 at 6:23









VindhujaVindhuja

7005 silver badges24 bronze badges




7005 silver badges24 bronze badges







  • 1





    you have to use inside cms_index_index.xml file

    – Rakesh Jesadiya
    Dec 12 '16 at 6:25











  • Use link instead of script tag in declaration.

    – Rakesh Jesadiya
    Dec 12 '16 at 6:29












  • 1





    you have to use inside cms_index_index.xml file

    – Rakesh Jesadiya
    Dec 12 '16 at 6:25











  • Use link instead of script tag in declaration.

    – Rakesh Jesadiya
    Dec 12 '16 at 6:29







1




1





you have to use inside cms_index_index.xml file

– Rakesh Jesadiya
Dec 12 '16 at 6:25





you have to use inside cms_index_index.xml file

– Rakesh Jesadiya
Dec 12 '16 at 6:25













Use link instead of script tag in declaration.

– Rakesh Jesadiya
Dec 12 '16 at 6:29





Use link instead of script tag in declaration.

– Rakesh Jesadiya
Dec 12 '16 at 6:29










1 Answer
1






active

oldest

votes


















0














You have to create cms_index_index.xml file to declare js inside your hompeage,



Using cms_index_index.xml file You can display all js inside Homepage only.


Your xml path would be below,




appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file




<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<link src="Vendor_Module::js/jquery-1.10.2.min.js"/>
<link src="Vendor_Module::js/jquery.easing-1.3.pack.js"/>
<link src="Vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<link src="Vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>





share|improve this answer

























  • I have included the above content in appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file. On viewing page source of the home page, the js files are not included. I am getting an error in console as 'ReferenceError: jQuery is not defined'

    – Vindhuja
    Dec 12 '16 at 6:41











  • Have your js file path, appcodeVendorModuleviewfrontendwebjs?

    – Rakesh Jesadiya
    Dec 12 '16 at 6:43











  • I have included the js file in appcodeVendorModuleviewfrontendwebjs

    – Vindhuja
    Dec 12 '16 at 6:45











  • please remove var folder from root and run php bin/magento setup:static-content:deploy command. Also remove your browser cache

    – Rakesh Jesadiya
    Dec 12 '16 at 6:46











  • Still I am not able to see the js files added in my custom module on viewing the page source

    – Vindhuja
    Dec 12 '16 at 6:55













Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f149850%2fmagento-2-adding-jquery-in-home-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














You have to create cms_index_index.xml file to declare js inside your hompeage,



Using cms_index_index.xml file You can display all js inside Homepage only.


Your xml path would be below,




appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file




<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<link src="Vendor_Module::js/jquery-1.10.2.min.js"/>
<link src="Vendor_Module::js/jquery.easing-1.3.pack.js"/>
<link src="Vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<link src="Vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>





share|improve this answer

























  • I have included the above content in appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file. On viewing page source of the home page, the js files are not included. I am getting an error in console as 'ReferenceError: jQuery is not defined'

    – Vindhuja
    Dec 12 '16 at 6:41











  • Have your js file path, appcodeVendorModuleviewfrontendwebjs?

    – Rakesh Jesadiya
    Dec 12 '16 at 6:43











  • I have included the js file in appcodeVendorModuleviewfrontendwebjs

    – Vindhuja
    Dec 12 '16 at 6:45











  • please remove var folder from root and run php bin/magento setup:static-content:deploy command. Also remove your browser cache

    – Rakesh Jesadiya
    Dec 12 '16 at 6:46











  • Still I am not able to see the js files added in my custom module on viewing the page source

    – Vindhuja
    Dec 12 '16 at 6:55















0














You have to create cms_index_index.xml file to declare js inside your hompeage,



Using cms_index_index.xml file You can display all js inside Homepage only.


Your xml path would be below,




appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file




<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<link src="Vendor_Module::js/jquery-1.10.2.min.js"/>
<link src="Vendor_Module::js/jquery.easing-1.3.pack.js"/>
<link src="Vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<link src="Vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>





share|improve this answer

























  • I have included the above content in appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file. On viewing page source of the home page, the js files are not included. I am getting an error in console as 'ReferenceError: jQuery is not defined'

    – Vindhuja
    Dec 12 '16 at 6:41











  • Have your js file path, appcodeVendorModuleviewfrontendwebjs?

    – Rakesh Jesadiya
    Dec 12 '16 at 6:43











  • I have included the js file in appcodeVendorModuleviewfrontendwebjs

    – Vindhuja
    Dec 12 '16 at 6:45











  • please remove var folder from root and run php bin/magento setup:static-content:deploy command. Also remove your browser cache

    – Rakesh Jesadiya
    Dec 12 '16 at 6:46











  • Still I am not able to see the js files added in my custom module on viewing the page source

    – Vindhuja
    Dec 12 '16 at 6:55













0












0








0







You have to create cms_index_index.xml file to declare js inside your hompeage,



Using cms_index_index.xml file You can display all js inside Homepage only.


Your xml path would be below,




appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file




<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<link src="Vendor_Module::js/jquery-1.10.2.min.js"/>
<link src="Vendor_Module::js/jquery.easing-1.3.pack.js"/>
<link src="Vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<link src="Vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>





share|improve this answer















You have to create cms_index_index.xml file to declare js inside your hompeage,



Using cms_index_index.xml file You can display all js inside Homepage only.


Your xml path would be below,




appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file




<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>

<link src="Vendor_Module::js/jquery-1.10.2.min.js"/>
<link src="Vendor_Module::js/jquery.easing-1.3.pack.js"/>
<link src="Vendor_Module::js/jquery.mousewheel-3.0.4.pack.js"/>
<link src="Vendor_Module::js/jquery.fancybox-1.3.4.pack.js"/>

</head>
</page>






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 12 '16 at 7:18

























answered Dec 12 '16 at 6:29









Rakesh JesadiyaRakesh Jesadiya

31.3k15 gold badges81 silver badges135 bronze badges




31.3k15 gold badges81 silver badges135 bronze badges












  • I have included the above content in appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file. On viewing page source of the home page, the js files are not included. I am getting an error in console as 'ReferenceError: jQuery is not defined'

    – Vindhuja
    Dec 12 '16 at 6:41











  • Have your js file path, appcodeVendorModuleviewfrontendwebjs?

    – Rakesh Jesadiya
    Dec 12 '16 at 6:43











  • I have included the js file in appcodeVendorModuleviewfrontendwebjs

    – Vindhuja
    Dec 12 '16 at 6:45











  • please remove var folder from root and run php bin/magento setup:static-content:deploy command. Also remove your browser cache

    – Rakesh Jesadiya
    Dec 12 '16 at 6:46











  • Still I am not able to see the js files added in my custom module on viewing the page source

    – Vindhuja
    Dec 12 '16 at 6:55

















  • I have included the above content in appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file. On viewing page source of the home page, the js files are not included. I am getting an error in console as 'ReferenceError: jQuery is not defined'

    – Vindhuja
    Dec 12 '16 at 6:41











  • Have your js file path, appcodeVendorModuleviewfrontendwebjs?

    – Rakesh Jesadiya
    Dec 12 '16 at 6:43











  • I have included the js file in appcodeVendorModuleviewfrontendwebjs

    – Vindhuja
    Dec 12 '16 at 6:45











  • please remove var folder from root and run php bin/magento setup:static-content:deploy command. Also remove your browser cache

    – Rakesh Jesadiya
    Dec 12 '16 at 6:46











  • Still I am not able to see the js files added in my custom module on viewing the page source

    – Vindhuja
    Dec 12 '16 at 6:55
















I have included the above content in appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file. On viewing page source of the home page, the js files are not included. I am getting an error in console as 'ReferenceError: jQuery is not defined'

– Vindhuja
Dec 12 '16 at 6:41





I have included the above content in appcodeVendorModuleviewfrontendlayoutcms_index_index.xml file. On viewing page source of the home page, the js files are not included. I am getting an error in console as 'ReferenceError: jQuery is not defined'

– Vindhuja
Dec 12 '16 at 6:41













Have your js file path, appcodeVendorModuleviewfrontendwebjs?

– Rakesh Jesadiya
Dec 12 '16 at 6:43





Have your js file path, appcodeVendorModuleviewfrontendwebjs?

– Rakesh Jesadiya
Dec 12 '16 at 6:43













I have included the js file in appcodeVendorModuleviewfrontendwebjs

– Vindhuja
Dec 12 '16 at 6:45





I have included the js file in appcodeVendorModuleviewfrontendwebjs

– Vindhuja
Dec 12 '16 at 6:45













please remove var folder from root and run php bin/magento setup:static-content:deploy command. Also remove your browser cache

– Rakesh Jesadiya
Dec 12 '16 at 6:46





please remove var folder from root and run php bin/magento setup:static-content:deploy command. Also remove your browser cache

– Rakesh Jesadiya
Dec 12 '16 at 6:46













Still I am not able to see the js files added in my custom module on viewing the page source

– Vindhuja
Dec 12 '16 at 6:55





Still I am not able to see the js files added in my custom module on viewing the page source

– Vindhuja
Dec 12 '16 at 6:55

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f149850%2fmagento-2-adding-jquery-in-home-page%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?