back soft

مطالب مرتبط با «javascript using» در back soft | نویسنده: استخدام کار

Download file from s3 in browser using javascript

Vote count: 0 I want to implement an auto download functionality in browser from s3. I am currently using an anchor tag(created on the fly using javascript) using the following code var link = document.createElement("a"); link.download = name; link.href = file; if(callback) callback(); link.click(function(){ document.body.removeChild(link); }); But this approach does not work in safari because instead of downloading the file, it opens it in the browser(pdf file) and hence prevents the actual html to be rendered. I researched and found that safari does not implement the download tag of html5. Is there another way to download files in the browser. Or any s3 SDK available to do the same? asked ...

ادامه مطلب

Codeception phpbrowser using javascript

Vote count: 0 Long story short, I have a web application where i have a button which triggers 2 async ajax calls. The 2 ajax calls use a parameter which is actually a javascript variable set in the application. When the two ajax calls are done, a third ajax call is performed using the result from one of the initial ajax calls. This third ajax call, when done, adds a new div in the content. So far I used CodeCeption with WebDriver, where the above functionality was easily simulated by two simple actions: $I->click(button) $I->waitForElementVisible(newdiv) I am now trying to simulate the same using PhpBrowser but I'm not certain how to approach this: Since PhpBrowser doesn't use javascript, ho...

ادامه مطلب

Calculate price and quantity using jquery or javascript

Vote count: -1 How to calculate price and quantity. I don't want to remove currency type. The price is php generated so i just want to show a calculated price when update quantity using jquery or javascript. Thank you. Here is working demo : $('input[name='quantity']').on('change keyup click', function() { var price = $('.price').text().substr(1); var quantity = $('.quantity').val(); $('.total').text(price * quantity); }); Total : $50.00 Price : $50.00 edited 58 secs agoj08691 asked 2 mins agoprotik Let's block ads! بخوانید...

ادامه مطلب

Dependency Injection with Exact Example using Angular Javascript

Vote count: 0 I am New to lea a Angular Javascript. Can anyone gave me the knowledge of Dependency Injection with Its Demo Example. So That I did lea from there. No Good and clear link I have found from Googling. asked 1 min agoSupriya Pandey Let's block ads! بخوانید...

ادامه مطلب

Input validation (JavaScript) using required attribute

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...

ادامه مطلب

Not able to redirect users using javascript

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...

ادامه مطلب

using javascript on qualtrics: questions ids in looped blocks

Vote count: 0 I'm using the following code to modify the form answer: $('QR~QID24~1').insert({after: ' out of'}); $('QR~QID24~2').style.position = "relative"; $('QR~QID24~2').style.left = "100px"; $('QR~QID24~2').style.bottom = "34.5px"; This doesn't work anymore because when the block is looped the question is repeated five times, with the following names: QR~1_QID24~1 QR~2_QID24~1 QR~3_QID24~1 QR~4_QID24~1 QR~5_QID24~1 I tried to repeat the code with every name: $('QR~1_QID24~1').insert({after: ' out of'}); $('QR~1_QID24~2').style.position = "relative"; $('QR~1_QID24~2').style.left = "100px"; $('QR~1_QID24~2').style.bottom = "34.5px"; $('QR~2_QID24~1').insert({after: ' out of'}); $('QR~2_Q...

ادامه مطلب

Remove limit on markers using Google Maps API Javascript

Vote count: 0 This is my first post on Stackoverflow as after hours researching on how to deal with this problem (searching on Stackoverflow itself) I've decided to ask you guys for help. I'd like to know how to remove the "limit" on markers that this piece of code has. I'm quite new using Google Maps API, so I do apologize in advance if the code looks confusing. I'm using the Geocode feature + Autocomplete feature from Google Maps API. Places Searchbox html, body { height: 100%; margin: 0; padding: 0; } #map { height: 100%; } .controls { margin-top: 10px; border: 1px solid transparent; border-radius: 2px 0 0 2px; box-sizing: border-box; -moz-box-sizing: border-box; height: 32px; outline: no...

ادامه مطلب

how to display data from database in card ui using javascript or jquery

Vote count: -1 Hi Everyone I am newbie to web development so can you help me to solve below questions Questions to be solved 1) suggest me best UI design to implement in web as above in image. 2) And From the database,I need to display data as above image in html by using any one of the scripting language JavaScript and Jquery. if there any other scripting language that can be used to optimize performance please suggest me with a code Thanks in advance. edited 1 min agojcubic asked 4 mins agoRaj.2498 Let's block ads! بخوانید...

ادامه مطلب

Is it possible to activate a windows application window using javascript?

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! بخوانید...

ادامه مطلب

Using Javascript in Underscore template

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...

ادامه مطلب

Upload an image using html/javascript/Mongodb/WebServices

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! بخوانید...

ادامه مطلب

Using CSS and/or JavaScript, how do I scale a block element to appear close to the same size on multiple mobile devices?

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...

ادامه مطلب

Count and add Dynamic ID and for values for form elements using javascript

Vote count: 0 I am creating a list which has some form elements like html checkbox or radio-buttons. I want to give them dynamic ID and for values to its corresponding LABEL tag. All this but using JQuery/JavaScript. I am not that good in JavaScript $(document).ready(function() { function { var count = 0; var total = $('.product-menu li').length(); } }); .product-menu { display: block; list-style: none; margin: 0; padding: 0; } .product-menu li { display: list-item; line-height: 2; } .product-menu label { font-weight: normal; vertical-align: middle; padding-left: 10px; display: inline-block; } New Arrivals Accessories Bags Jackets asked 43 secs agoDeepak Yadav Let's block ads! بخوانید...

ادامه مطلب

Getting TypeError using Angular.js and Javascript

Vote count: 0 Hi i am getting the following error while selecting data using angular.js. Error: angularjs.js:107 TypeError: Caot set property '0' of undefined at n.$scope.removeBorder (adminCustomerNewController.js:55) at fn (eval at (angularjs.js:212), :4:617) at n.$eval (angularjs.js:132) at angularjs.js:251 at angularjs.js:263 at m (angularjs.js:7) at $$writeModelToScope (angularjs.js:263) at angularjs.js:263 at g (angularjs.js:261) at f (angularjs.js:261) My code is given below. {{d.day_name}} Select Category Select Subcategory My controller side code is given below. $scope.listOfSubCatagory = []; $scope.removeBorder=function(index,catvalue,parent){ console.log('ind',index,catvalue,paren...

ادامه مطلب

Making restrictions to selects using javascript [duplicate]

Vote count: 3 i have the following problem: I started to create a form with HTML an JS and there are two Dropdowns (Country and City). now i want to make these two dynamic with JQuery so that only the cities of the selected countries are visible. I've started with some basic JS which worked fine but makes some trouble in IE. Now i'm trying to convert my JS to JQuery for a better compatibility. My original JS looks like this: function populate(s1, s2) { var s1 = document.getElementById(s1); var s2 = document.getElementById(s2); s2.ierHTML = ""; if (s1.value == "Germany") { var optionArray = ["|", "magdeburg|Magdeburg", "duesseldorf|Duesseldorf", "leinfelden-echterdingen|Leinfelden-Echterdinge...

ادامه مطلب

Convert html page to pdf file using javascript

Vote count: 0 Can I create a pdf file using javascript? If yes, how can I do it? I need help and guide. I really appreciate for any help. asked 1 min agoD. Clara T This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers....

ادامه مطلب

Javascript: JSON with multiple matches using lodash

Vote count: 0 Suppose i have an array looklike this var users = [ { 'users': [{user:'harry',user:'potter',user:'jiy',user:'weasly'}], 'age': 36, 'active': true }, { 'users': [{user:'brad',user:'pit',user:'angelena',user:'joly'}], 'age': 40, 'active': false } ]; From this i want to select json with condition users object match multiple values eg: if the names are harry and angelena the output becomes this { 'users': [{user:'harry',user:'potter',user:'jiy',user:'weasly'}], 'age': 36, 'active': true }, { 'users': [{user:'brad',user:'pit',user:'angelena',user:'joly'}], 'age': 40, 'active': false } Eg: if the name is harry output becomes this { 'users': [{user:'harry',user:'potter',user:'jiy',use...

ادامه مطلب