Vote count: 0 in Angular 2 project written in typescript and packaged with webpack I add e.g. following throw to welcome.ts file: @Page({ templateUrl: 'build/views/welcome/welcome.html' }) export class Welcome{ constructor(){ throw('something went wrong') } } In JS console, I see following error and stacktrace: EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error during instantiation of Welcome!. ORIGINAL EXCEPTION: something went wrong ERROR CONTEXT: [object Object]BrowserDomAdapter.logError @ browser_adapter.js?f9d6:77 BrowserDomAdapter.logGroup @ browser_adapter.js?f9d6:87 ExceptionHandler.call @ exception_handler.js?1ee2:57 (anonymous function) @ application_ref.js?7cf8:194 EventEmi...
ادامه مطلبVote count: 0 I have a problem with input validation using 'patte' and 'required' attribute. The idea is that i want to use my own title, not of the browser. When I want to complete de input with characters that not correspond with the regex (numbers), message 'Only letters allowed' displays near the input. But when I complete with letters it shows me the same message that my characters are incorrect. Who knows want is the problem? Thank you. function validation (textbox) { var regex = /^[a-zA-Z]+$/; if (textbox.value == '') { textbox.setCustomValidity('Required field'); } else if(!regex.test(textbox.value)){ textbox.setCustomValidity('Only letters allowed'); } else { textbox.setCustomValidi...
ادامه مطلبVote count: 0 I'm trying to run the most basic of TypeScript tests using Jasmine and Chutzpah and I just can't get it to work. Here is the source file: class Simple { public easyTest() { retu 5; } } Here is the spec: /// /// describe("Simple Calculations", () => { it("should retu true", () => { var simpl = new Simple(); expect(simpl.easyTest()).toBe(5); }); }); Here is my chutzpah.json file: { "RootReferencePathMode": "SettingsFileDirectory", "Framework": "jasmine", "Compile": { "Mode": "Exteal", "Extensions": [ ".ts" ], "ExtensionsWithNoOutput": [ ".d.ts" ] }, "References": [ { "Path": "../../../src/typescript/classSimple.ts" } ], "Tests": [ { "Path": "simpleSpec.ts" } ], "EnableTracing": t...
ادامه مطلبVote count: 0 I have a page where user will click on it to send invites to his friend on gmail here is the button Import your Gmail Contacts here is the javascript part function TwkInvite() { alert('function is called'); window.location.href = "https://accounts.google.com/o/oauth2/auth?client_id=*********-*************.apps.googleusercontent.com&redirect_uri=https://www.example.com/app/invite-send&scope=https://www.google.com/m8/feeds/&response_type=code"; } I have tried window.location.href, window.location, location.href everything This function is being executed perfectly as alert is also executed but i don't know why it doesn't redirect to google website, whenever i click on button the p...
ادامه مطلبVote count: -1 I am sending file bytestream data as a multipart formdata to 'fileUpload' webservice (which is written in Java) using curl in PHP code. But i want to know is it possible any way to check how much multipart data send to webservice. Thanks in advance asked 3 mins agoYogiDev Let's block ads! بخوانید...
ادامه مطلبVote count: 0 n00b coder here, 0 professional or school training, so have mercy. I'm trying to create two spreadsheets: one tracks student attendance at school, the other tracks their attendance at Track practice. The goal is to write a function, that I can set up as a button, that I can click that will automatically send emails to several people if the student is present at school but is absent for sports without getting excused. Right now, the whole thing is working pretty well, but I have one issue. I have a column that will read "Good" or "Bad" depending on whether the student meets the above condition. The function tus these into an array. I would like to use the index of the "Bad"'s to...
ادامه مطلبVote count: 0 I feel like I have quite an easy question but I just don't get to the answer... I parse the .text() of a response from my server with JSON.parse into JSON. And i actually can access the values of that JSON with: this.temp[0].name. Now i just want to iterate over that JSON and push the values into a string array. But how can i achieve this? When i attempt to use for...of the compiler wants a string or an array but not a JSON. When i attempt to use for...in it actually does not go into the loop. Here is some code where i can access it fine: this._pS.getAllProjects() .subscribe(data => this.temp = JSON.parse(data.text()), err => console.log(err), () => console.log("hello " + this....
ادامه مطلبVote count: 0 I hope I worded the title correctly... I currently have this function below: function renderDataTable(serviceUrl) { var $dataTable = $('#example1').DataTable({ "ajax": serviceUrl }); }; When the page is ready, I use this to send the url to set the table: renderDataTable('api/qnams_all.php'); // api/qnams_all.php is the serviceUrl I'm trying to send some values to a PHP script and retu the records entered by the user: $('#searchSubmit').on('click', function (){ var searchbooking = $('#searchbooking').val(); var searchquote = $('#searchquote').val(); $.post('api/qnams_test.php', {searchbooking: searchbooking, searchquote: searchquote}, function(data) { renderDataTable('api/qnams_...
ادامه مطلبVote count: 0 In Toad for Oracle it is possible to see the DDL script for a particular table. I'm trying to figure out a way to quickly pull only the ALTER TABLE ADD FOREIGN KEY CONSTRAINT ddl for nearly 50 tables instead of going to all the tables and grabbing them. Is there a catalog table for this or a way to pull only that part? asked 1 min agouser3224907 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have another action script 3 class which is linked back to main. I'm trying to addChild to stage but i'm getting an error: Call to possibly undefined method to child. If I paste the same script in my main.as then it adds the movie clip perfectly fine? I'm getting the hello message back so its definitely linked ? This is my code. //Importing movieclip. import MainBackground; //We need to refer to the main background. var mainbackground:MainBackground = new MainBackground(); //We then need to posistion this. mainbackground.x = 32; mainbackground.y = 85; addChild(mainbackground); trace("Hello"); asked 3 mins agoR H Let's block ads! بخوانید...
ادامه مطلبVote count: -2 I am using the following JavaScript to open a popunder, but right now it's opening only 1 popunder per cookie session, i.e. 1 popunder for 24 hours, and I want to open 2 popunders per session, i.e. 2 popunders open at the same time. How do I do that? function Set_Cookie(name, value, expires, path, domain, secure) { var today = new Date(); today.setTime(today.getTime()); var expires_date = new Date(today.getTime() + (expires)); document.cookie = name + "=" + escape(value) + ((expires) ? ";expires=" + expires_date.toGMTString() : "") + ((path) ? ";path=" + path : "") + ((domain) ? ";domain=" + domain : "") + ((secure) ? ";secure" : ""); } function Get_Cookie(name) { var start = ...
ادامه مطلبVote count: -2 I'm a novice in web programming. I just genuinely have a hard time thinking of one thing that javascript does better than jsp. asked 4 mins agouser2911983 Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I want to run four tcl at the same time. In shell, I can use "&" to run. Is there something in tcl like "&" to run concurrently? I just want to run four independent tcl in one terminal and don't want to use multi-thread. asked 4 mins agoTomas Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I tried to do the javascript to validate the date enter is in correct way. For example, for ETA(estimate time arrival), the date should be earlier than ETD(estimate time departure). This is the form: ETA ETD And for the javascript: function validate1 { var x = document.getElementById("etadate"); var y = document.getElementById("etddate"); if (x < y) { true; } else { false; } } When i tried to run the code, it didnt give any notice to the user that the date for eta should be earlier than etd. I dont know where to adjust so the code run correctly. asked 1 min agoathirah asmadi Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am currently injecting a Javascript file into a webpage from a chrome extension in order to auto-fill and submit a form on the webpage. Furthermore, I need this script to continuously auto-fill and execute the script. However, the form submission only will occur at the end of the script, forcing me to run the entire script multiple times rather than use a loop on the script's content. How can I go about ruing the same Javascript file over and over on a webpage? The method I am currently doing seems to fail and runs the script only once. Here is my current background.js: // listen for our browerAction to be clicked chrome.browserAction.onClicked.addListener(function (tab) { ex...
ادامه مطلبVote count: 0 I am struggling with the best ways to load a responsive / mobile page, and then I found a jQuery plugin that uncomment things depending on the screen width. I found it perfect since I wouldn't need extra HTTP requests and for the mobile user it will be faster. But, I stumbled on a problem: this jQuery plugin caot load / render other scripts. You can see in this fiddle I just did: https://jsfiddle.net/g3f88q5k/ It uncomments the section I wanted, but the script that makes the twitter a button a twitter button doesn't work. How can I make it work, if there's any way of doing it? asked 1 min agoThiago Borbolla Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Im just creating a simple tool in PHP what uses the built in whois command in linux and then echo's the response back to the user. Everything I have attempted has either failed or I have messed up somewhere. For me nothing happens, for the record I am new to PHP and I would like just a little expertise. Im the only one that is going to be using the script. Thank you. asked 1 min agoGrizPwnz Let's block ads! بخوانید...
ادامه مطلبVote count: 0 Can anyone help me clean this up so it will work? I don't know Javascript and I just need to know enough to make this particular automated task work. I'm trying to create a zap in Zapier to parse an email into usable bits to pass on to Google Sheets and Salesforce. First, I pass the email through the formatter to replace all of the carriage retus with ::::: as a delimiter. The emails are labeled using a Gmail filter and are always have 2 or more of the following fields, but often times not all of them: Full Name Organization EmailPhone Number How did you hear about _____ _____ty? What else? I tried created a script using this video: https://www.youtube.com/watch?v=pTqhr6uZ2AE I...
ادامه مطلبVote count: 0 I am trying to create a useame textbox that blocks the user's input if it is any of these (!,@,#,$,%,^,&,*,(,),+,=,;,:,`,~,|,',?,/,.,>,...
ادامه مطلبVote count: 0 I'm inserting a video tag into a webpage but the video for some reason doesn't show up even though it's found the video resource. I looked in the console and found == $0 which I've never seen before and didn't know if it had something to do with it. Does anyone know what this means? asked 2 mins agointhenameofmusik 1 Answer Vote count: 0 That isn't JavaScript. It is just a marker to tell you which DOM element you have selected in the DOM inspector. answered 17 secs agoQuentin Let's block ads! بخوانید...
ادامه مطلب