In tutorials I've learnt to use document.write. Now I understand that by many this is frowned upon. I've tried print(), but then it literally sends it to the printer.  So what are alternatives I should use, and why shouldn't I use docum...
I desperately need some help on this one.  I've created a <script> that closely parallels, and reproduces the problem of, another more complex <script> that I've written elsewhere.  Here's what it does:   creates an <iframe...
I have a small calculator that I'm adding to my html. It has a few dropdowns to select stuff and when a person hits a submit button, I'd like to display a picture below the calculator in my html. I've tried using a javascript function wit...
Is it possible to print / display a JavaScript variable's name? For example:  var foo=5; var bar=6; var foobar=foo+bar;  document.write(foo+ "<br>"); document.write(bar+ "<br>"); document.write(foobar + "<br>...
load jQuery from source  What I like to do is to drop my local jquery.js and have it hosted somewhere else. But what if Google is down? So let's code a fallback that uses another source if jQuery is "still" not loaded...  I made this test...
I am writing a script that needs to add DOM elements to the page, at the place where the script is located (widget-like approach). What is the best way to do this?  Here are the techniques I am considering:   Include an element with an id="Locato...
I'm new to this so please bear with me. I am trying to write a chrome extension that does the following:   Detect www.website.com/anypage.html. If this website is detected, then do the following. Don't load the URL.  Instead, write a blank do...
Say I have an html code like this:  <script>     // just an example function to get data from input     function getNumber(form) { var userInput = new Number; // convert form values into numbers userInput = Number(form.enteredNumber.value); ret...
I am using Flask and pass variables (image_name) to javascript to get dynamic web content. I use those variables within document.write() to display a image file. Depending on the variable image_name the required .jpg file should be loaded.  This is m...
This is all I've got going, but my debugger says 'document.write can be a form of eval,' and my jsonString variable prints as undefined. Any help is appreciated, thanks.   function getUrlVars() {         var map = {};         var parts =...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.