Skip to content

problems with jquery plugins #1034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Antonioele opened this issue Feb 10, 2015 · 6 comments
Closed

problems with jquery plugins #1034

Antonioele opened this issue Feb 10, 2015 · 6 comments

Comments

@Antonioele
Copy link

Magento The version is 0.42.0-beta7 with sample data
in luma/Magento_Theme/layout I have insert file default_head_blocks.xml :
in the head I have insert

    <css src="css/camera.css"/>
    <script src="camera.js"/>

1° problem :
camera.js there is in pub/static/frontend/Magento/luma/it_IT

I see whith firebug
some times load camera.js at other times do not.
problem layout magento and requirejs ??????????
2° problem
I have create block camera with widget camera
but some times when I call camera plugin I have this problem: jquery not found
magento load first camera.js or block camera and after jquery.

@antonkril
Copy link
Contributor

You should use data-mage-init attribute on your widget node to initialize your camera widget. Its source file will be automatically loaded by requirejs. (see http://devdocs.magento.com/guides/v1.0/frontend-dev-guide/javascript/js-mage-plugin.html#fedg_js-mage_widgets_dataattrib)

To make your widget load after jquery, declare jquery as a dependency in your widget (http://requirejs.org/docs/api.html#funcmodule)

@vpelipenko
Copy link
Contributor

@Antonioele, did @antonkril comment solve your problem?

@Antonioele
Copy link
Author

@vpelipenko , I solve my problem with the help of antonkril , using requirejs , sorry if I insist, it is not advisable to use the layout to load jquery plugins, it would be comfortable as in magento 1.9.

@vpelipenko
Copy link
Contributor

@Antonioele, due to last changes in the framework, it is strongly recommended now to use requirejs to load any js plugins.

@vpelipenko
Copy link
Contributor

@Antonioele, do you have other questions about plugins? if no, can we assume this issue resolved?

@vpelipenko
Copy link
Contributor

@Antonioele, this issue will be closed. I hope we've helped you to resolve your problem. If you have any other problems or questions about jquery plugins, feel free to reopen this issue or create new one.

mmansoor-magento pushed a commit to magento-mpi/magento2 that referenced this issue May 9, 2016
[FearlessKiwis] MAGETWO-31891: Changes made in tax configuration are not seen in backend...
magento-team pushed a commit that referenced this issue Apr 21, 2017
[Firedrakes] MAGETWO-67477: Add @api annotation to Sales module
magento-engcom-team added a commit that referenced this issue Nov 1, 2019
…arameters #1034

 - Merge Pull Request magento/graphql-ce#1034 from TomashKhamlai/graphql-ce:extend-data-provider-missed-params-shipping-address
 - Merged commits:
   1. 1a42940
   2. f63ab29
   3. 124384d
   4. 4464396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants