Vote count: 0 I have a page on my website which id like to lock down the content to an article with a survey, I have added the JS survey script in the header of the page as instructed but it seems to be doing nothing asked 56 secs agoCosmin George Let's block ads! بخوانید...
ادامه مطلبVote count: 0 The link to my pen in CodePen - http://codepen.io/PartTimeCoder/pen/WwMxEX?editors=0010 The Javascript is here: function randomNum(digits) { retu Math.floor(Math.pow(10, digits - 1) + Math.random() * 9 * Math.pow(10, digits - 1)); } function askQuestion(digits) { $(".result").html(""); var factor1 = randomNum(digits); var factor2 = randomNum(digits); var correctanswer = factor1 * factor2; var answer = parseInt($(".answer").val(), 10); console.log(correctanswer); $(".question").html(factor1 + " × " + factor2); var score = 0; //Problem Starts Here $(".check").click(function() { if (correctanswer == answer) { $(".result").html("Correct"); score += 1; $(".score").html(score); askQu...
ادامه مطلبVote count: 0 So this is my very first code in javascript! kind of a copy/make my own code kind of thing, Ive been trying to go through tutorials and kind of get it? but well this code doesn't work! and wanted to find out why??? maybe an explanation why so i understand where im going with this... document.write("Random # (1-5) = ", Math.floor((Math.random() * 5) + 1), ""); if(Random = 2){ alert("Your names Bob"); }else { alert("Your names Superman"); } so i asked it to write to the page a random number between 1 and 5, (works fine...) then said if the random number is 2 i wanted to alert the page that there name is bob and if the number isn't 2, alert them that there name is superman... Comp...
ادامه مطلبVote count: 1 I'm making a website.For which I require movie description.How to do that with TMDB API? asked 3 mins agoAkash Mehta Let's block ads! بخوانید...
ادامه مطلبVote count: 0 ok, if a transition is set on a style via CSS it works and keeps working as long as the style is not changed by Javascript (then the transition stops) even if the Javascript restores the original property to its former value. Is there a way to revive a transition after a style has been "touched" ? For example once the Javascript sets the width to the value of 100px (which was the CSS value) the transition stops. div { width: 100px; height: 100px; background: red; -webkit-transition: width 2s; /* For Safari 3.1 to 6.0 */ transition: width 2s; } div:hover { width: 300px; } var el = document.getElementById("test"); el.style.width = "100px"; asked 2 mins agoThomas An Let's block ad...
ادامه مطلبVote count: 0 I am trying to build a web page that will contain a list of windows from another Windows application (Trade Ideas). Is it possible for me to use links in this web page to activate the Trade Ideas windows? In other words I would use Javascript to activate the corresponding Trade Ideas window when it's name is chosen from the list. asked 1 min agoRob Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have been attempting to create an automated lost and found search system using cognito forms, zapier and google sheets. When a form is submitted, zapier creates a new row in the "inquiries" worksheet. I have been able to create formulas that use the input information to search the second worksheet "event data" for matching data but using an ARRAYFORMULA doesn't perform with 100% accuracy. I have used CountIFs to indicate that submitted data cells have a matching counterpart in the database, but I don't think these would be horizontally linked. Despite the unlikely event that multiple pieces of information would occur, perhaps a script or additional arguments would work. When ...
ادامه مطلبVote count: 0 Dim app, fso, file, fName, wb, dir dir = "D:TA" dirsave = "D:TAXLS" Set app = CreateObject("Excel.Application") Set fso = CreateObject("Scripting.FileSystemObject") For Each file In fso.GetFolder(dir).Files If LCase(fso.GetExtensionName(file)) = "csv" Then fName = fso.GetBaseName(file) Set wb = app.Workbooks.Open(file) app.Application.Visible = True app.Application.DisplayAlerts = False app.ActiveWorkbook.SaveAs dirsave & "" & fName & ".xls", 56 app.ActiveWorkbook.Close app.Application.DisplayAlerts = True app.Application.Quit End if Next I use this script to open csv file and save them in another directory as xls file. I also want to add one more feature - I want to free the t...
ادامه مطلبVote count: 0 I need to display formatted date using my underscore.js template. I am using moment.js. My template is as follows: // date, homeTeamName, homeTeamName values come from JSON object + + : This does not render the template properly. Gives an error: underscore.js:1454 Uncaught SyntaxError: missing ) after argument list which is somewhere deep in underscore.js. What's the proper syntax to put a JSON value inside code in the template, i.e. how can I pass date, which comes from JSON object; into moment() The code which I want to generate in template looks like this: var matchDay = moment("2016-05-15T15:00:00Z"); // date should fill from JSON value matchDay.format("MMMM-DD-YYYY"); aske...
ادامه مطلبVote count: 0 I am getting very confused with regards to importing a Typings file, there seems to be so many ways to do it. I am writing a nodejs program. I installed momentJS via typings (not an ambient module) and I have manged to import it like so var testOne = require('moment/moment'); import * as testTwo from 'moment'; import * as testThree from 'moment/moment'; It seems all three ways are working. 1st option is the original node require way I am used to... the other 2 seem to be a typescript import. I have used a single moment directory structure and moment/moment and they seem to equally work. I am ignoring typings/browser... So my directory structure for the moment is actually stored...
ادامه مطلبVote count: 0 I have a matlab script that wants to load a .mat file that is in a directory fixed relative to the location of the script. The script itself could be in different places relative to the current working directory, so the location of the .mat file is not known relative to the it. How do I specify the location of the file to load relative to the script that is executing? asked 41 secs agopythonic metaphor Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I want to upload an image from the user's disk to my MongoDB. When I have the all path, it works. But with , it doesn't works (not the complete path, and it's normal, for the security ...) So I want to know if there is an other way to do that ... (Even a solution where I store directly on the server will be ok (Using javascript, html, ajax, ... ) Thank you. asked 1 min agoMasiwan Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have built a Dashboard that has multiple calculations using R Scripts and now I want to publish this to our inteal Server. I get the following error message: "This worksheet contains R scripts, which caot be viewed on the target platform until the administrator configures an Rserve coection." From what I understand, the administrator has to configure the Rserve, but what about the rest of the installed packages I have in use? Should the administrator install those too and every time I use a new package, I should inform him to install that particular package? asked 53 secs agoNick Dragosh Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I want to describe a type that has the following behavior export class myData { key : string; display_name : string; } However I want to have dynamic name for key and display_name eg. the following would be valid myData type mySample1:myData = { myKey : 'myKeyValue' myName : 'myNameValue' } mySample1:myData = { myKey2 : 'myKeyValue2' myName2 : 'myNameValue2' } Is this possible in typescript? If it is possible, is this a good idea in typescript? asked 30 secs agotesting Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I use Vietnamese in input content to an textbox like "ngày 1". The first time I do Javascript.Serialize an object & put it in array, store in cookie: class sampleCookie { public string tripDate; } => I got right value string is "ngày 1". Again, I add new record to this list with another string "ngày 2". => I got the first record value string is "ngà y 1" I can't figure out the way to Encoding for it. What I'm missing? asked 3 mins agoNguyễn Tiến Đạt Let's block ads! بخوانید...
ادامه مطلبVote count: 0 How can I get my javascript library to support multiple events with on? Here is the code for my on function: Q.fn.on=function(event, fn){ this[0]["on" + event] = fn; }; Also how can my on function add events to multiple elements? asked 2 mins agoNuts Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have some problems with this code.. I'm trying to make a list where users can insert their favourite beer. there have to be a check if the "userinput" is already in the array.. My thoughts where as follow: loop through the beersArray and check if there is a value in the array that is the same as what user puts in. -> if so -> alert and do not add. IF NOT > add the user input to a list item I tried to find a solution to make it work but couldn't find it, I hope someone can help me out! Sebas var submitBier = document.getElementById("submitbeer"); submitBier.addEventListener("click", function(){ event.preventDefault(); var beersArray = []; var beer = document.getElementById("fa...
ادامه مطلبVote count: 0 I built a Google Cardboard app (or at least a Google Cardboard-compatible app with room for improvement) that works well on phones with 5-6" screens (iOS and Android) and a Google Cardboard viewer designed to work with those 5-6" screens. However, if viewing the app in a larger "phablet" screen, vision doubles and the app becomes useless for those devices. Since the app primarily runs in the phones' stock browsers Safari and Chrome, is there a way to scale down the app canvas/block element to stay within the 5-6" range on larger mobile devices? Here is a rough illustration of what I'm trying to accomplish: So far my search brings me to answers like this one, explaining that thi...
ادامه مطلبVote count: 0 as I described in the title. in my code I have a google map script in the header and it works very well let's call this script tag (A). the problem is that when I'm not in the script tag A and want to call a function that is in the script A from another script tag to reuse it. it will not work. however if I copied the code from that function and put it directly in the same tag it will work. I want to be able to call it not to write it again. what is the wrong thing in my code?? here is my code the script A (the one in the head tag) //this is the function that I want call function getAddress(location) { var geocoder = new google.maps.Geocoder(); var latLng = new google.maps.LatL...
ادامه مطلبVote count: 0 I thought this would be simple, but I can't figure it out. If someone types "completed" into A1, I want it to send an email to a specific email address. Initially I set up a "completed" button, but it doesn't work on mobile. So I now just need it to send me an email when someone types in the word "completed". asked 2 mins agoChris Norris Let's block ads! بخوانید...
ادامه مطلب