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

Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form