question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jQuery script for specific component (server side rendering)

See original GitHub issue

If server side rendering, jQuery will not work because “jQuery need a document within a window”. How would I write jQuery script with a specific component? Maybe like the way context.insertCss() work. Would we make something named: context.insertScripts()?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

3reactions
voquockhanhcommented, Aug 25, 2016

@manhhailua in component you create componentDidMount() and componentDidUpdate(), and write jquery there (remmeber import jquery to your html.js) example: http://semantic-ui.com/introduction/integrations.html

0reactions
manhhailuacommented, Aug 25, 2016

@voquockhanh2: then where will you put these lines of code in a specific component?

  $(function () {
    // using jQuery
  });
Read more comments on GitHub >

github_iconTop Results From Across the Web

Is it possible to server-side render jQuery with ReactJS.Net?
Got it working (live demo), I just needed to move the call to React.render outside of the jsx file and pass in what...
Read more >
How to Render Javascript per page or component?
Setup RequireJS ; "jquery", "jquery.royalslider" ; "jquery.mobile.events"], function ; $) { var ; BasicSlider; return ; BasicSlider = (function ...
Read more >
Server side rendering JavaScript from PHP \ Seb De Deyne
Server side rendering is a hot topic when it comes to client side ... This instantiates a Vue component with a template and...
Read more >
Node.js Server Side Rendering (SSR) using EJS
Server -side rendering (SSR) is a popular technique for rendering a normally client-side only single page app (SPA) on the server and then ......
Read more >
Optimizing third-party script loading in Next.js
The size, latency, and loading of third-party scripts can significantly affect a site's performance. The Next.js Script component comes with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found