Questions tagged as 'javascript'

1
answer

Doubt with revealing pattern

Is it possible to do this with revealing pattern? the console always returns undefined function FlashService() { return{ get: get }; var _abc = 'teste'; function get() { console.log(_abc); return a...
asked by 28.10.2014 / 22:08
2
answers

How to draw print from a web page using backend rails?

Would it be possible to do this? For example: I point a page to my application , and it holds a image of the indicated page. A print.     
asked by 25.07.2014 / 13:46
2
answers

Javascript, action on selected text

Galera would like to know how to do an action on text selected in textarea, for example I selected the word 'hi' and when I click a button with Onlick, change the text to 'bye'. I await the answer, because I am looking all day and I do not th...
asked by 20.08.2015 / 21:11
2
answers

JavaScript does not work if placed in the head tag

Well, I need the Tag Script to be inside the Tag Head, but unfortunately it's only working when I put it in the end of the html. Please, if anyone knows why this is happening, please give some help. This is HTML: <!DOCTYPE html> <h...
asked by 08.07.2015 / 21:00
4
answers

Increase image when user clicks JS

I would like help with a problem I'm having: I'm doing something similar to a gallery, and when the user clicks on the image it has to open in full size, not the whole screen, but it covers a good part of the page. Also, I need it to center....
asked by 06.01.2016 / 14:53
1
answer

What causes a popup to be blocked?

I have noticed that some libraries, such as login with facebook, always use popups for user authentication, and almost always, this popup is not blocked. Generally, when it is opened with a click event there are no locks. And when we use w...
asked by 16.11.2015 / 18:28
1
answer

Is there any way to add css rules by javascript?

If I have the following tag style : <style> body{ color:red; } </style> Would it be possible to add a new css rule as within that style through Javascript ? For example, I want to add this to the end of...
asked by 14.12.2015 / 17:54
1
answer

How to convert a JavaScript array to array in PHP?

The system gives me a JavaScript matrix to work on the page. I can get this array with PHP, but I do not know how to convert from JavaScript to PHP and work using PHP. This is an example of the JavaScript array: <script type="text/...
asked by 02.03.2015 / 04:04
2
answers

Add attribute to an element

In JavaScript we can add attributes to a given element in at least two ways: var div = document.createElement('div'); div.id = 'meuId'; or var div = document.createElement('div'); div.setAttribute('id', 'meuId'); Is there any differenc...
asked by 02.04.2015 / 16:47
4
answers

How to create a custom context menu?

When we right click on certain areas of the page the default PopUp of browsers appears: I'd like to showcase my own custom PopUps ! Is it possible to intercept the click and open a different menu?    Note: I have JavaScript p...
asked by 10.02.2016 / 16:37