Hi,

I am guessing that you add this to the <head></head> part of your template?

I think the problem is that you haven't created the item with the
"show-more" class before adding an event listener to it.

Try adding:

$(window).ready(function() {
});

around your js function.

Regards,

Andréas


Den tis 25 juni 2019 kl 09:56 skrev Soumen Khatua <[email protected]
>:

> Hi Folks,
>
> When I'm using my javasscript/jquery code inside django template then it's
> working fine but when I'm save it in external file called main.js then it's
> functionality not responding but url is working.I did all the process but
> still problem is same??
>
> Myproject:
>      |   myproject
>      | myapp
>      | static
>          | css
>              | style.css ( this is working fine )
>           .....
>            | js
>               | main.js ( url is working but functionality is not working
> )
>
> settings.py :
>
> STATIC_URL = '/static/'
> STATIC_ROOT = os.path.join(BASE_DIR,'assets')
> STATICFILES_DIRS = [
>
> ('favicons',os.path.join(BASE_DIR,'static','favicons')),
>                     ('images',os.path.join(BASE_DIR,'static','images')),
>                     ('css',os.path.join(BASE_DIR,'static','css')),
>                     ('js',os.path.join(BASE_DIR,'static','js')),
>                     ]
> base.html:
>
> {% load staticfiles %}
> <script src="https://code.jquery.com/jquery-2.2.4.min.js";
> integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
> crossorigin="anonymous"></script>
> <link rel="stylesheet" href="{% static 'css/style.css'%}">
> <script type="text/javascript" src="{% static 'js/main.js'%}"></script>
>
> Please help me guys. I attached some screen shot for your better
> understand.
>
> Thank You.
>
>
> Regards,
> Soumen
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPUw6WYSeJL0G51A5Osd3D6XAFwtow9tcfKdC7CD_jz144p07Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAPUw6WYSeJL0G51A5Osd3D6XAFwtow9tcfKdC7CD_jz144p07Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK4qSCcvYWujVp2UP2DDpXbUcCUiABfvpycCQYHoOs63dNXJyw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to