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;
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
add a comment |
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
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
add a comment |
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
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
magento2 jquery
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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>
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
|
show 4 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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>
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
|
show 4 more comments
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>
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
|
show 4 more comments
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>
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>
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
|
show 4 more comments
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
|
show 4 more comments
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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