Vote count: 1 When I hit my submit button it just goes straight to the php page. The javascript does not load at all. This is very confusing because I am receiving no errors in console nor when I validate the javascript using exteal error checkers (such as JShint). The javascript was working at one point in my coding so I have no idea why it stopped working. JAVASCRIPT: //jQuery $(document).ready(function() { // listen for a click event on any radio element $('input[type="radio"]').click(function() { // get the id of the clicked element var id = $(this).attr('id'); // fade out any existing image elements $('img').fadeOut(800, function() { // fade in the image element with the id we're after,...
ادامه مطلبVote count: 0 my array that i download from the server looks like this, array=[ { icon: 'm-waing', color: '#FDC204', name: 'exp1', team: 'c', user: 'alpha' }, { icon: 'm-puzzle', color: '#86AF45', name: 'exp2', team: 'c', user: 'alpha' }, { icon: 'm-refresh', color: '#77A746', name: 'exp3', team: 'c', user: 'alpha' }, { icon: 'm-puzzle', color: '#86AF45', name: 'exp3', team: 'a', user: 'beta' }, { icon: 'm-clock', color: '#4677A7', name: 'exp4', team: 'b', user: 'beta' }, { icon: 'm-waing', color: '#FDC204', name: 'exp5', team: 'a', user: 'gamma' } ] If i need to create a nested object( # of exps, belonging to respective teams, organized by user) from the above array how would i go about it....
ادامه مطلبVote count: 0 I'm coming across some weirdness with a variable not being accessible in other functions after being set. This is a Celery task file named html.py base_path = '' @app.task(bind=True) def status(self): """ retus the count of files downloaded and the timestamp of the most recently downloaded file """ num_count = 0 latest_timestamp = '' for root, _, filenames in os.walk(base_path): for filename in filenames: file_path = root + '/' + filename file_timestamp = datetime.fromtimestamp(os.path.getctime(file_path)) if latest_timestamp == '' or file_timestamp > latest_timestamp: latest_timestamp = file_timestamp num_count += 1 @app.task(bind = True) def download(self, url='', cl_id=-1): ...
ادامه مطلبVote count: 0 I'm just leaing JavaScript and I've wondered why this has to be done this way. asked 1 min agoEyasu Felleke Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I am writing an automation script in python using argparse module in which I want to use the -s as an option which takes file/file path as an argument. Can somebody help me to do this? asked 1 min agoAlagu Jeeva Let's block ads! بخوانید...
ادامه مطلبVote count: 0 My OSX App is sandboxed, and I would like to give users an option to install some optional bash scripts into ~/Library/Application Scripts/ Apple review doesn't like the method i have used: opening a seperate window with an option to drag&drop into the correct location. I referred to this article, and thought it would be ok for the MAS: https://www.objc.io/issues/14-mac/sandbox-scripting/ Does anyone have any tips about how to go about this? I seem to remember some apps providing a download of exteal scripts, but if Apple doesn't like the drag&drop, why would they prefer an option to download in the UI instead? Or would I need to direct users to my site after purchase, and tell...
ادامه مطلبVote count: 0 My PDF will only support two lines (I predefined the dimensions of the input box on the PDF). Is there a way to check if user input on the front end will only make up to two lines on the PDF side? I tried to see if I could find character width lengths and then adding up the lengths of the characters the user enters, but that didn't go anywhere. asked 3 mins agoimonlyacontractor Let's block ads! بخوانید...
ادامه مطلب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! بخوانید...
ادامه مطلبVote count: 0 I have this script #!/bin/bash rename_files() { title="${1##*${2} - }" for filename in "$1/"*.*; do case "${filename##*.}" in doc|doc|doc) mkdir -p -m 777 "/Users/Desktop/Documents Share/Downloaded/${title}" new_path="/Users/Desktop/Documents Share/Downloaded/${title}/${title}.${filename##*.}" let "iters=1" while [ -f $new_path ] ; do new_path=$new_path"$iters" let "iters++" done echo "moving $filename -> $new_path" mv "${filename}" "${new_path}" ;; esac done } rename_category() { for path in "/Users/Desktop/Documents Share/Downloads/${1}"*; do rename_files "$path" "$1" done } rename_category DOC This script automatically moves and renames files contained in /Users/Desktop/Docu...
ادامه مطلبVote count: 0 I have written a Perl script that takes an input hexadecimal value and then retus the binary equivalent. I need to sign that 8-bit integer and view the signed integer's value. This particular scenario does not seem to be covered in the Perl documentation that I have seen. The script is pasted below: #! perl use waings; print "Enter hexidecimal number:"; chomp ($hexNum = ); print $hexNum . "n"; print join "n", map { unpack ('B*', pack ('H*',$_)) } split ':', $hexNum; asked 1 min agoJoel Schmidt Let's block ads! بخوانید...
ادامه مطلبVote count: -2 I am trying to create a surface, where the whole page is full of divs, where everyone of them can be clicked and the color can be changed through the HTML5 Colorpicker. ------------------------------------------------------------------ * This Part is Only if you want really to understand what I am trying to do* I would only create a bunch of , but the problem is, you caot tu the style of them off completely, there is always a grey line in the button and the area to be colored is always smaller then the size of the input element. So I am trying to hide them behind the array of divs and call a click on the element behind the clicked div via jquery or js. ------------------------...
ادامه مطلب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...
ادامه مطلبVote count: 0 This is my code of the .htmlbody .htmlBody=" However, it needs to be downloaded before you can see the logo. So I put the logo inside the excel file, how do I convert it into an shape object and concatenate it inside the .htmlbody asked 7 mins agoastropringles Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a jQuery mobile site. one of the tags in the body is a javascript script tag with a src param . The Javascript does some magic and retus an embedded shockwave object in an iframe in the page (this is a 3rd party script so I have no control over what or how it works). This works fine on a non-Ajax loaded page, but even in my desktop browser this will not work with a page in the JQuery mobile app. I do not get an error of any sort and I can see in the Network tab that the Javascript is found successfully. asked 1 min agoScott Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have very sparely used Javascript. I am trying to create a dialog box of type prompt which will display a text field. How it will work: User clicks on the Flag anchor link....
ادامه مطلبVote count: 0 I'm testing an app with Protractor; I want to simulate a click on a button 5 times but I don't want to write the same code x5. how can I do it? element(by.css('button.click')).click(); asked 1 min agopaolopolix Let's block ads! بخوانید...
ادامه مطلبVote count: 0 I have a select dropdown in my webpage created dynamically as Select your option I have it dynamically populated, when another event (button click) occurs $('body').on("click", "#addOption", function () { createOption(); $('#mainDropDown').val($("#newOption").val()).trigger('change'); $("#newOption").val("") }); function createOption() { for (var k in OptionList) { // OptionList has the list of options already added to the dropdown tempSelectedState = ""; if ($("#newOption").val() == OptionList[k].name) { tempSelectedState = "selected"; } $("#mainDropDown").append("" + OptionList[k].name + ""); //$('body #mainDropDown').val().trigger('change'); } } Here the problem, is the sele...
ادامه مطلبVote count: 0 I have a youtube image parser function in javascript. Which is perfectly work when a youtube url inserted in the input box. I want the function to work automatically with the pre-put text. For example, this value (url) loaded from database. And once the page is completely loaded. This function is call up and execute the thumbnails without doing anything with the box nor click. Javascript: function youtube_parser(url) { var regExp = /.*(?:youtu.be/|v/|u/w/|embed/|watch?v=)([^#&?]*).*/; var match = url.match(regExp); if (match && match[1].length == 11) { urllink = match[1]; imagelink = ""; } else { //urllink = "test" } document.getElementById("ytimagelink").value = urllink; docum...
ادامه مطلبVote count: 0 I am attempting to dynamically create an object with name-value pairs using html input fields. This is what i have so far: var taskComplete = { newTask: function(arg) { var fieldObj = {}, selector = arg, inputFields = document.getElementsByClassName(selector); for (var i=0;i...
ادامه مطلبVote count: 0 I have this navbar hider script for handheld devices: function bindNavUp() { var lastScrollTop = 0, delta = 5; $(window).on('scroll', function() { var st = $(this).scrollTop(); if(Math.abs(lastScrollTop - st) lastScrollTop) { // downscroll code $('header.main').css('top','-50px').hover(); } else { // upscroll code $('header.main').css('top','0'); }; lastScrollTop = st; }); }; function unbindNavUp() { $(window).unbind('scroll'); }; function handleNavUp() { if ($(window).width() < 1600) { bindNavUp(); } else { unbindNavUp(); }; }; $(document).ready(function() { var timer; $(window).on('load resize scroll', function() { clearTimeout(timer); timer = setTimeout(function() { handleNa...
ادامه مطلب