multiple function

hello developers. Im trying to create ecommerce website . shopping-cart, order, login functions are working perfect but search and pagination codes (bootstrap and js) not working. is that possible run Js and django same time? If you wanna see source code please let me know and share your email *

At the same time? Yes. But not in the same place.

Django runs on the server. JavaScript runs in the browser.

If your JavaScript code needs some data from Django, you use AJAX functions to call a Django view. That view can return data to your JavaScript, which can then update your page.

But you always need to be aware that these modules (Django and JavaScript) are running in two different places. It’s up to you to coordinate the activity between them.

1 Like

Thank you mr Whitesell. Any suggestion AJAX for Django ?

That’s going to depend upon what JavaScript framework(s) you may be using.

Historically, I have used jQuery. Currently for new work, I’m mostly using HTMX.

But you’ll want to pick whatever fits in best with whatever JavaScript libraries you’re already using.

1 Like

well i cant make any progress. Htmx, bootstrap datatable, js function, django datatable. Nothink work please help.

You’ll need to post the code that is involved that you need help with. Try to limit what you post to the first error or problem you are encountering. Pick one issue for us to help you with and we can work forward from there.

Note: When posting code here, copy/paste the code into your reply, surrounded between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted. Do not post images of code.

1 Like