Questions tagged as 'javascript'

2
answers

How to use Resources in .js file?

I have an Asp.Net MVC project where I am using Resources , and to use it on my web pages p> @using projeto.Translations <h3>@Resources.DISPLAY_OLA</h3> The problem is that I have some items (buttons, for example) that are d...
asked by 24.07.2015 / 13:26
2
answers

can not set property 'innerHTML'

I'm trying to make a game of the gallows and I want it to show the letters already typed correctly appear the preview in the divs, but gives the following error in chrome    forca.js: 95 Uncaught TypeError: Can not set property 'innerHTML' of...
asked by 21.06.2018 / 13:47
1
answer

JavaScript modules

I'm having the following error when trying to run a module in JavaScript:    Uncaught SyntaxError: Unexpected identifier index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta...
asked by 23.06.2018 / 21:02
2
answers

Get script from a DIV with JS

It is possible to get the SCRIPT of some element .. EX: <div id="form"> <div class="box"> <p>Pegar apartir da 'class="box"'</p> </div> </div> get the complete code inside the id="form"...
asked by 24.07.2015 / 21:31
2
answers

Javascript or Jquery - how to do an inventory of divs classes

I have a div of id = colors and inside it I have other divs with several classes <div id="cores"> <div class="azul">conteúdo</div> <div class="amarelo">conteúdo</div> <div class="verde">conteúdo&...
asked by 04.07.2018 / 01:53
2
answers

Focus on the next input when reaching the maximum number of characters

I created a directive to move the cursor to the next field when it reaches the maximum size of characters, as follows: var app = angular.module("myApp", []); app.directive("moverProximoCampo", function() { return { restric...
asked by 25.06.2018 / 21:53
1
answer

Request ajax with unexpected return

I have an ajax code that makes a request in a php file, and in this php file has only one    echo json_encode ('test') In return, the string "teste"NULL , always with this NULL is returned, after any return. $.ajax({ url:...
asked by 12.05.2018 / 15:59
3
answers

Jquery .text printing only once

$.getScript("func2.js", function() { $(".teste1").text("1"); $(".teste2").text("2"); }); <div class="teste1" style="color: red"><div> <div class="teste2"><div> Why did he only enter once?     
asked by 17.05.2018 / 19:33
1
answer

Change all words in an HTML code

I need to do a Javascript function that changes all words found inside a website. I've tried something like this: var elements = document.getElementsByTagName('div'); for (var i = 0; i < elements.length; i++) { var txt = elements.replac...
asked by 23.05.2014 / 16:54
2
answers

on () and bind () are not working

I am using off() in an element to disable its functionality and need to enable it again with on() . But it is not working when on() is executed ... Here's the code, I'm trying to prevent a form from being sent 2 times when...
asked by 24.05.2014 / 20:03