I have exactly the same code below except the top is from the HeadFirst JS book where they declare output as a blank variable then assign it a string. Second is me messing around and seeing the code still works without first declaring output as a blank variable. What’s the use for declaring output; blank ..
Category : variables
Good day. So sorry if this was asked before, but in that case I am unsure of what to ask to get the answer – so do link me up if so. What I want to do is simple, take an input field’s data, assign it to a variable in javascript. To please not be ..
I need a for loop that gives, var x = (math random value with a range of 150 minimum, and 1280 maximum). Also a var y = (math random value with range of minimum 150, and 610 maximum). It gives the x and y value to a function, that displays them in a canvas. They ..
I have 3 arrays to be passed to the variables of a URL. I’ll like to know how to pass them to the URL. export default function () { let p_code = [‘P’, ‘Y’, ‘M’, ‘C’]; let c_flg = [‘O’, ‘C’, ‘B’]; let page = [‘H’, ‘F’, ‘W’]; let res = ""; for (var i ..
I’m a beginner and I’ve started making a website. I need to take the delta created from the quill text editor and save it in the database. The variable is in the script tag as HTML. I need that variable extracted to views.py and I think I will be able to do the rest… hopefully. ..
So, I do not understand why my variable continues to show as undefined AFTER I have declared it and assigned it a value in another function. var test; function message(){ test = window.confirm("test quote"); } window.setTimeout("message()", 2000); console.log(test); What I am trying to achieve is a true or false return value from the User when ..
I have a bunch of content pages that follow a modular design with 10 or so variable components on the page. It’s relatively complicated in that there are a whole bunch of media queries to make the various components responsive and to ensure that they adapt at the same times. The pages are single column. ..
Sorry, this question is a bit different. I want the webpage formatting to be randomly assigned. So something like this: $color1 = {document.body.style.backgroundColor = "#AA0000"}. I’d do this for five different colors, etc. Then, JavaScript could randomly choose which format (color) to implement. I’m a real beginner. Sorry. I hope to learn a lot from ..
I need some data from SQL to Javascript, so I called them in PhP and I’m trying to pass these values to Javascript, but the code below causes a NaN failure… if I set a PhP command for the Javascript variable, I can’t use it as a numeric value… <?php $val=12; ?> <script> var val="<?php ..
I have a block of codes from different websites in my files and me and my friends want to make a game. The idea is if the variable chosenPath is not selected yet then redirect to pathChooser.html to select this value to make the chosenPath select so that the variable is defined so the redirection ..
Recent Comments