{"version":"1.0","provider_name":"123 Reg Blog: Small business tips, insight and advice","provider_url":"https:\/\/www.123-reg.co.uk\/blog","author_name":"123 Reg","author_url":"https:\/\/www.123-reg.co.uk\/blog\/author\/123-reg\/","title":"Javascript: What is Javascript? | 123 Reg Blog","type":"rich","width":600,"height":338,"html":"<blockquote class=\"wp-embedded-content\" data-secret=\"bnihNKwouP\"><a href=\"https:\/\/www.123-reg.co.uk\/blog\/infographics\/javascript-what-is-javascript\/\">Javascript: What is Javascript?<\/a><\/blockquote><iframe sandbox=\"allow-scripts\" security=\"restricted\" src=\"https:\/\/www.123-reg.co.uk\/blog\/infographics\/javascript-what-is-javascript\/embed\/#?secret=bnihNKwouP\" width=\"600\" height=\"338\" title=\"&#8220;Javascript: What is Javascript?&#8221; &#8212; 123 Reg Blog: Small business tips, insight and advice\" data-secret=\"bnihNKwouP\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" class=\"wp-embedded-content\"><\/iframe><script>\n\/*! This file is auto-generated *\/\n!function(d,l){\"use strict\";l.querySelector&&d.addEventListener&&\"undefined\"!=typeof URL&&(d.wp=d.wp||{},d.wp.receiveEmbedMessage||(d.wp.receiveEmbedMessage=function(e){var t=e.data;if((t||t.secret||t.message||t.value)&&!\/[^a-zA-Z0-9]\/.test(t.secret)){for(var s,r,n,a=l.querySelectorAll('iframe[data-secret=\"'+t.secret+'\"]'),o=l.querySelectorAll('blockquote[data-secret=\"'+t.secret+'\"]'),c=new RegExp(\"^https?:$\",\"i\"),i=0;i<o.length;i++)o[i].style.display=\"none\";for(i=0;i<a.length;i++)s=a[i],e.source===s.contentWindow&&(s.removeAttribute(\"style\"),\"height\"===t.message?(1e3<(r=parseInt(t.value,10))?r=1e3:~~r<200&&(r=200),s.height=r):\"link\"===t.message&&(r=new URL(s.getAttribute(\"src\")),n=new URL(t.value),c.test(n.protocol))&&n.host===r.host&&l.activeElement===s&&(d.top.location.href=t.value))}},d.addEventListener(\"message\",d.wp.receiveEmbedMessage,!1),l.addEventListener(\"DOMContentLoaded\",function(){for(var e,t,s=l.querySelectorAll(\"iframe.wp-embedded-content\"),r=0;r<s.length;r++)(t=(e=s[r]).getAttribute(\"data-secret\"))||(t=Math.random().toString(36).substring(2,12),e.src+=\"#?secret=\"+t,e.setAttribute(\"data-secret\",t)),e.contentWindow.postMessage({message:\"ready\",secret:t},\"*\")},!1)))}(window,document);\n\/\/# sourceURL=https:\/\/www.123-reg.co.uk\/blog\/wp-includes\/js\/wp-embed.min.js\n<\/script>\n","thumbnail_url":"https:\/\/www.123-reg.co.uk\/blog\/wp-content\/uploads\/2025\/06\/Content-Creation-1440x460-2-scaled.jpg","thumbnail_width":2560,"thumbnail_height":818,"description":"JavaScript is a programming language that web browsers can run directly. It lets a web page respond to what you do, from clicking a button to typing in a search box. For example, when you click \u2018Add to basket\u2019 in an online shop, JavaScript can tell the shop\u2019s server which product you\u2019ve chosen and update the number beside the basket icon without reloading the page. \u00a0 What is JavaScript? When you open a web page, your browser reads the HTML to build the page and uses CSS to style it. The browser also runs any JavaScript the page loads. That code can respond to what you do, such as swapping the product photo when you choose a different colour. Here\u2019s what happens when you add a little JavaScript to an HTML button: HTML &lt;button type=\"button\"&gt;Click me&lt;\/button&gt; HTML puts a button labelled \u2018Click me\u2019 on the page. The label stays the same when you click it. HTML with JavaScript &lt;button type=\"button\" id=\"demo-button\"&gt;Click me&lt;\/button&gt; &lt;script&gt; const button = document.getElementById('demo-button'); button.addEventListener('click', () =&gt; { button.textContent = 'Thanks for clicking!'; }); &lt;\/script&gt; JavaScript listens for a click and changes the button\u2019s label to \u2018Thanks for clicking!\u2019 Note: With Website Builder or Managed Hosting for WordPress, you can easily build your website without ever needing to write code. Any JavaScript or PHP runs in the background, leaving you free to focus on building your site and running your business. See also:\u00a0What is PHP? \u00a0 What is JavaScript used for? JavaScript helps websites respond as you use them. It can open a menu, show search suggestions as you type or flag a missing email address before you submit a form. In WordPress, JavaScript powers features like moving blocks around in the editor. On a Woo shop, it can update the basket when someone adds a product or fetch a new set of results when they apply a filter. How JavaScript compares with other web languages Language What it does Where it\u2019s used Example HTML Gives a web page its structure. Browser Marks up the product name, image and price. CSS Controls how a web page looks. Browser Sets the button colour and adjusts the layout for phones. JavaScript Makes pages interactive and can also run on the server. Browser and server Updates the basket total without reloading the page. PHP Builds pages and handles requests on the server. Server Fetches product details from the database and builds the page in a Woo shop. Python Powers web apps and processes data on the server. Server Finds matching products when someone searches a shop built with Python. \u00a0 Is JavaScript the same as Java? Java and JavaScript are separate programming languages. JavaScript is built into web browsers and is widely used to make pages interactive. Java is commonly used for business software and applications that run on servers. \u00a0 Can JavaScript run on a web server? Yes. A tool called Node.js lets developers run JavaScript on the server. In an online shop, JavaScript in your browser might send a request when you choose a product size. JavaScript on the server can check stock and send back the number available."}