Jump to content

Search the Community

Showing results for tags 'javascript'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

  1. Hi Everyone, I'm trying in a bootstrap view to replace two dropdown lists (yes/no) by two toggle checkboxes. Here is the part of code used on the Edit View : <div class="row"> <div class="col-md-3" style=""> <div class="col-sm-12"> <label for="d_c" class="col-sm-12 control-label">DC</label> </div> </div> <div class="col-md-3" style="" > <div class="col-sm-12"> <label for="i_m_c" class="col-sm-12 control-label">IMC</label> </div> </div> <div class="col-md-6" style=""
  2. I have an intersection observer for one animation, but i want to use window.requestIdleCallback() Where I should add the code window.requestIdleCallback(callback_1)? my script: if (document.querySelector('#weddings')) { let observer_1; let Element_1; let prevRatio = 0.0; let options = { root: null, rootMargin: "0px", threshold: buildThresholdList() }; // Set things up Element_1 = document.querySelector("#img-1"); initObserver(); ////////////////////////////////////////////////////////////////////////////// function initObserver() { observer_1
  3. I am pretty new to javascript and node.js. I am wanting to display some text using document.getElementById('txt').innerHTML= "some text" followed by a node module : var spawn = require('child_process').spawnSync; child = spawn('ffmpeg',['-y -i ',some_file , result_file ], { shell: true }); (which takes some time) and then document.getElementById('txt').innerHTML= "some other text"; However it only disp[ays the second lot of text after the external program has finished. I had assumed that as I am using the synchronous version of spawn that the fir
  4. I followed the following tutorial and I was finally able to add a slide in menu on my WordPress site. However, I noticed that the body scrolls when moving up and down on my mobile phone. Can someone explain to me how I can disable body scroll when the menu is opened? Many thanks in advance! Tutorial: https://www.w3schools.com/howto/howto_js_sidenav.asp <script> function openNav() { document.getElementById("mySidenav").style.width = "100%"; } function closeNav() { document.getElementById("mySidenav").style.width = "0"; } </script>
  5. Hi, I've used this code in my website. I want "Hide --> Show", but the explenation automatic do "Show --> Hide". Is there a way to flip the code?
  6. I have this script and would like to make it search if just the word Mango is in the array and if it is true console.log the index of it. <!DOCTYPE html> <html> <body> <h1>Array includes()</h1> <p>Check if the fruit array contains "Mango":</p> <p id="demo"></p> <p><strong>Note:</strong> The includes method is not supported in Edge 13 (and earlier versions).</p> <script> var fruits = ["Banana is yellow", "Orange juice", "Apple is red", "Mango is orange"]; var n = fruits.includes("Mango"); console.log(n); &l
  7. $(function() { $("#demo").keyup(function(){ var len = $("#demo").val(); if(len.length>8){ var el = $("<p></p>").html(""); $("#holder").append(el); //$("p").addClass("alert alert-warning"); var x = $("<span></span>").html(" Too long"); $("p").append(x); $("span").addClass("glyphicon glyphicon-alert"); stop(); } else if(len.length<=8){ $(
  8. jsonLikeObj.getFoo.value( ); BACKGROUND: Consider the following object var jsonLikeObj = Object.create( {}, {getFoo: { value: function() { return this.foo = 1; }, enumerable: false } } ); DISCUSSION: Now I could more easily understand the following that does not work, than what does work. What Does Not Work jsonLikeObj.getFoo.value(); What Does Work jsonLikeObj.getFoo(); QUESTION: What is going on? Roddy
  9. I have 3 fields that are the same name as corresponding column in MySQL database. First field is a dynamic dropdown list called "eventname". Second field called "eventdate" is an input field that gets populated via choice made from "eventname" dropdown list / First field. Third field called "venuename" is an input field that gets populated via choice made from "eventname" dropdown list / First field. What this dynamic dropdown list does is select the eventname from database then there is an onchange function th
  10. I need to get the raw window handle for a html / javascript window (hwnd in windows 10), using javascript / node.js / nwjs but can't find a way. does anybody have any ideas? I want to embed mpv or mplayer in a window using the -wid option which requires the window handle as an integer. Or does anyone have any ideas how to do this as an alternative? Thanks
  11. Hello All, I have a question in regards to an idea I have and was curious as to which of the JavaScript tutorials would be a good place to start. What I had in mind was an image that would swap through a series of pictures, say for example of 10. I would like these images to swap over over in one of four directions randomly, image 2 would say for example slide image 1 from the top, image 3 would slide from the left, etc. Which of the JavaScript Tutorials here would be a good place to start for this idea? I am aware of the setInterval() command to switch between images after x amount of mi
  12. Hello! I'm looking for some help with my Javascript code. I have a services page with 5 tabs. I used w3schools to obtain and tweak this code as needed. However, I need to link to a specific tab from my home page and I'm having trouble editing the Javascript to make this possible. Here's what I have thus far: Services Page HTML: <div class="col"> <button class="tablinks" onclick="openCity(event, 'nonclinical')"><div class="tab-wrap-blue"><div class="nonclinical" style="height: 90px;"> </div><div class="tablink-head stories mobile-no"><h4>N
  13. BACKGROUND: I recently install nodejs and npm and downloaded a library call xregexp.js Then, I discovered what I did not know. The applications nodejs (node) and npm are primarily designed for server-side Javascript. Now, I am confused. In PHP one can simply include or require PHP from another document file and employ it wherever you like that PHP can be used. When I try to do something similar with xregexp.js I inevitably fail and am told that the script cannot be found. Now, I have node and npm installed above my domain folders so that it can be used with all of my domains. Simpl
  14. QUESTION: Is the following an accurate statement? If not, please clarify how a unicode string literal differs from say, an ASCII string literal. Roddy Untitled-1.html
  15. I copied the game code from w3 schools for a school project, however I wanted to change the turning and moving object from a red square to an image. Now everything works fine but the image does not turn when the object turns, how do I fix this. Here is my code: <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"/> <style> canvas { border:1px solid #d3d3d3; background-color: #f1f1f1; } </style> </head> <body onload="startGame()"> <script> var myGamePiece; functi
  16. I like the automatic slideshow in the example here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_slideshow_auto, but would like 2 slideshows on one page. When I try to do this myself, one slideshow plays and finishes, then the other one starts and finishes. I would like them to start at the same time and loop and like the caption option but don't necessarily need the "dots".
  17. Hi, i love the w3school web, I learn for first time coding here and so im fun because I have job with coding relation. But for React so hard to learn with bad english spech knowledge. So the w3school can added new tutorial about React JS? Thanks..
  18. Hello, I am using the How to Create Tabs tutorial (https://www.w3schools.com/howto/howto_js_tabs.asp), but I can't get the default tab to work. It seems to work in the Tryit Editor, but even pasting the code as is, it doesn't work. I am using Shopify and have a .js, .css, and a .liquid (page template) document. Other changes on the pages seem to take affect. {{ 'tabs.js' | asset_url | script_tag }} {{ 'tabs.css' | asset_url | stylesheet_tag }} {% include 'breadcrumb' %} <meta name="viewport" content="width=device-width, initial-scale=1"> <div class="grid"
  19. I'm trying to create a form that allows for calculation of metabolic rate. There is an if,then statement related to gender (formula changes if female vs male) I'd also like the result to be targeted to a specific part of the page (anchor). Ideally a new section can appear (maybe need to link a new page?) to provide further details Below is my code, any help would be so appreciated!! <head> <style> body { font: 15px gothic, sans-serif; letter-spacing: 1px; } input { width: 100%; } input[type=number] { border: none; border
  20. Hello. Any one here as experience with ionic 4 and express? I'm trying to do something simple: A simple login form for the user to enter login and password and a connect button. Once the user click on connect to send the data to the server. I wanna see the data on the server side maybe using an alert. Can anyone help me with that? It's been a couple of days I'm trying it. Please notice that I'm not trying something complex and the goal is to understand the concept, therefore the use of error handling, or whatever other utility to make the connection strong isn't necessary at al
  21. BACKGROUND: Recently I discovered a nifty Javascript function that counts the like values of an index array and returns as its value an object whose property-value pairs consist of a single repeated value and its corresponding frequency. Unfortunately, I am having trouble understanding how the function works. As I have adapted it to fit my own needs I have changed the variable names. Indeed, this change may be the source of my own confusion. The FUNCTION: function dateCounter(dates) { return dates.reduce( (countDates, date) => { countDates[da
  22. I am needing to convert an String input into an Integer. But before converting the String input, i have to do a validation that the String input can be converted to a numeric value. So If it cannot, i need to log a message saying “This cannot”. Then log another new log statement on the next line saying “be a number”. I understand I need a parseInt and isNan and if else statements but I am confused on exactly how they are implemented. I am new to javascript.
  23. I am designing a Sharepoint page with script editor. I have an image which I have used area tag on. So with onmouseover another image pops up and it reverts back onmouseout. I further want to use another area tag on this new image onmouseover where I can add area tags on this new image. Something like a nested image map. For description sake. I will use script from w3schools. <img src="planets.gif" width="145" height="126" alt="Planets" name="myname" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126" onmouseover=myname.s
  24. Hey guys, I know that this is quite a longshot but I hope that there is someone here that can help me. We've had problems with our Store Locator on our homepage for quite a long time since it was missing an API Code (which we got today). The site I'm talking about is this: http://www.melon-helmets.com/en/stores The Problem is: I don't know where to put the API. There is this line of code <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> My guess was that I'd have to enter the API key after js?, by adding key=ourk
  25. HI, I'm using RPC.Query to send a string from js to py. At py receptor this scrash using json.loads(..) de args. The messages error is: "" ... JSONDecoderError(\"Expecting value\", s, err.value) from None\njson.decoder.JSONDecodeEror: Expecting value: line 1 colum1 (char 0)\n", "message": "Expecting value: line 1, column 1 (char 0)"], "Exception_type":"internal_error"}}" "" I do an console.log(..) beford RPC instruction and the string value is ok. That is the code: FROM JS: .... // *JCM* var strcontenido = '';
×
×
  • Create New...