Questions tagged as 'javascript'

1
answer

Turning Javascript code into HTML?

I made a banner in the bannersnack site to be used in the eBay Marketplace, the site of the option to download the banner in GIF, PNG, JPG and HTML5 and makes available the code in JavaScript as well. The GIF does put it in eBay, however...
asked by 17.12.2015 / 19:46
1
answer

Delegate (similar to C #) in JavaScript

One feature I use extensively in C # is delegate which is a reference type used to reference anonymous or named methods. Especially the classes already implemented in the framework such as Action and Func , as shown below. public class...
asked by 20.07.2016 / 19:12
1
answer

Go back to the previous page by defining a variable

I would like to do the following echo "<script>window.history.back()</script>"; this returns you to the previous page What I intended was to go back to the previous page but define a variable imagine that the previous pa...
asked by 19.07.2016 / 12:22
1
answer

Anchor with Javascript

I have this code: $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash)...
asked by 01.12.2015 / 17:40
1
answer

Validate for js with for each

In this screen I need to do a validation so that in each record, when the registry is allowed, in case it is marked, bring me the registry that is marked every time I edit (check or uncheck the checkbox). In the case the best way I foun...
asked by 26.11.2015 / 15:29
1
answer

Array items relating to adding new item

I have a array that has 10 items, for example: var array_exemplo = ["item_1", "item_2", "item_3", "item_4", "item_5", "item_6", "item_7", "item_8", "item_9", "item_10"]; And in my html, I have several buttons, with id's, for example:...
asked by 28.11.2015 / 02:13
1
answer

How to calculate Total via JavaScript

To show the items in a sale I use a Json to display the data using this script. <script> $(document).ready(function () { var CodigoVenda = @ViewBag.CodigoVenda; $.ajax({ type: "GET", url: "/Venda/GetDadosIte...
asked by 30.11.2015 / 21:04
1
answer

Set CSS style for already filled fields

I have the following function in javascript: $('input').blur(function() { var $this = $(this); if ($this.val()) $this.addClass('used'); else $this.removeClass('used'); }); It adds the class used to the element i...
asked by 22.11.2015 / 04:00
1
answer

Insert Function Only If No Exist

The "window.showModalDialog" function exists in some versions of IE, but does not exist in Chrome, I would like to insert it if it does not exist. How can I do this? window.showModalDialog = function (arg1, arg2, arg3) { //Minha função }    ...
asked by 05.02.2016 / 15:19
1
answer

Drag n Drop pure Javascript

I'm trying to make a pure Drag'n Drop with Javascript: Example Two errors if I can not solve: 1 - When dragging List 2 it always places the element under the mouse and not above. 2 - When I try to get the element through Class...
asked by 25.11.2016 / 18:26