Questions tagged [javascript]

JavaScript is a dialect of the standardized ECMAScript programming language, primarily used for scripting web-pages.

Adapted from the SO Javascript tag.

The Basics

Javascript is probably the most ubiquitous programming language on the earth. It runs on virtually every OS, and a JS engine is included in virtually every mainstream web browser. Standalone Javascript engines or interpreters are available as well. Windows, for example, includes Javascript in its Windows Script Host, and Mozilla offers Rhino, an implementation of Javascript built in Java.

The Mozilla Developer Center offers good documentation on JavaScript.

JavaScript is most often used in the browser - see The Document Object Model.


ECMAScript, JavaScript & JScript

People often use the term "JavaScript" informally. The language and the term originated as a creation of Netscape.

ECMAScript was developed as a standardization of Netscape's JavaScript and Microsoft's independently-developed JScript. The canonical reference is The ECMA-262 Language Specification. While JavaScript and JScript aim to be compatible with ECMAScript, they also provide additional features not described in the ECMA specifications.

Most people today who use Javascript probably don't sweat the differences; they do not distinguish it from ECMAScript.

318 questions
5
votes
2 answers

Is there some published JavaScript with a list of 'interesting' test strings?

I went looking on the Google for a simple JavaScript object or other bit of JS code that can deliver a list of strings that are interesting for testing. I thought there would be a billion hits, but I couldn't find one. If I'm just doing my search…
Bruce
  • 784
  • 5
  • 10
3
votes
3 answers

How to generate HTML report with Mocha?

If anyone knows any examples for generating an html report in the Mocha framework, please share it. I have done googling and tried a lot but I have not been successful.
QAMember
  • 1,520
  • 14
  • 37
  • 57
1
vote
0 answers

Someone added a JavaScript alert() to my site

I went to my site to notice that as soon as I go to it, 2 seconds later an alert(1); pops up. It only shows the 1. After 1 -2 clicks of OK, it redirects to another site. How could this have happened and how can I figure out how to deter it?
1
vote
3 answers

(Google Chrome Extension) I want to click a link on a page but they all have similar hrefs

I want to click a link on a page but they all have similar hrefs This works for clicking the first link Code: await executeScript("document.querySelector('a[href*="/p/"]').click()"); How do I click the 10th link?
QuelKitz
  • 21
  • 5
1
vote
0 answers

How to write a script for signup on spring boot with angularjs

Our project is on spring boot with docker using angularjs for front-end. We use protractor for front-end tests. I want to write a script for easy signup by giving parameters. How can I do this and integrate to project? For example, may I use a…
mark
  • 235
  • 1
  • 4
  • 9
1
vote
1 answer

Unit testing client-side Javascript without the browser

I asked this question on the stackoverflow site: https://stackoverflow.com/questions/27469850/has-client-side-javascript-unit-testing-gotten-lost ...but I think it's a little to open ended. So instead... Does it make sense to unit test client-side…
0
votes
1 answer

How to test that pressing on an HTML input element causes the form to submit

Suppose you have:
It turns out somebody wrote the following code: $("#tbInput").on("keypress", function (e) { if (e.keyCode == 13) { // bad code! …
dx_over_dt
  • 103
  • 4