A
A
Alexander2015-03-31 01:25:08
WordPress
Alexander, 2015-03-31 01:25:08

Why put Jquery events in a separate .js file?

Friends, tell me, do they always take out the jquery code of events and so on (click, submit) in a separate .js file?
What are the best rules to follow?
A lot of php-parameters are passed to the jquery code. Parameters can only be passed by setting onclick=""?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2018-02-24
@dimonchik2013

Need to know the address for notification of incoming payments or transfers to the server address?

A
Alexander Aksentiev, 2015-03-31
@Sanasol

How convenient to do so. But probably if you want order, then build a modular structure. For example, using RequireJS: habrahabr.ru/post/152833
How is it transmitted?
The easiest and most convenient option is to make data-* attributes on the element and read them when the event fires.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question