Questions tagged as 'javascript'

2
answers

Do not prompt for credentials if user is not authenticated

I have a system with two sites in the same domain. The two sites are in separate folders of the same domain, something like this: http://renan/foo http://renan/bar The first site (let's call it " foo ") has a page that accesses data f...
asked by 19.09.2014 / 16:28
1
answer

Javascript performance: switch or if nested?

Which of the two alternatives provides the best performance in Javascript: switch or if nested? if { ... } else { if { ... } else { if { ... } else { ... } } } or switch(expression) { case n:...
asked by 20.06.2014 / 18:14
1
answer

Using Sqlite on Android with Phonegap

Well, I have a little problem ... I'm doing an application and I'm using sqlite on android to save a copy of my database, so far it's fine, it's working, it's copying the data the only problem I found is this. To make it clear I'm putting the...
asked by 09.10.2015 / 16:06
2
answers

How to convert an html string into a jQuery object?

How to convert an HTML to a jQuery object? var objeto = '<div id="minhaDiv"><span id="meuSpan">Span</span></div>';     
asked by 18.09.2015 / 19:09
3
answers

Know if a video paused to upload?

I'm using shaka-player to play a dash stream from a Nimble server, but I've been reading that waiting event is not always the most reliable option, and in fact when the video stops loading the image simply freezes, and my event is...
asked by 25.04.2017 / 18:38
3
answers

Is there any way to convert a string to base 64 in javascript?

Is there any way to convert a base64 string to javascript? In PHP we can do this: base64_encode('stack overlow'); //c3RhY2sgb3Zlcmxvdw== How can I do this in javascript?     
asked by 16.10.2015 / 17:13
2
answers

How to check real-time change in database with php websocket?

I want to update a div only when there is a change in a certain field in the database, I am currently using polling, but I want to switch to websocket for performance issues, but I only find examples of chats, and it's not what I need. Does any...
asked by 29.03.2017 / 17:55
3
answers

function $ .Ajax () return value?

this is the code: var res = VerFileRepetidoBancoAjax( "teste" ); console.log("res="+res); function VerFileRepetidoBancoAjax( str ){ $.ajax({ url: "caminho.", type: "get", dataType:"json", data: "dado="+ str, async:...
asked by 18.08.2014 / 17:05
2
answers

What is the difference between "String (1)" and "new String (1)" in Javascript?

Why in Javascript is it possible to call String as a function and also instantiating? See the example: var str1 = new String(1) var str2 = String(1) console.log("Valor é %s e o tipo é %s", str1, typeof(str1)); console.log("V...
asked by 28.11.2016 / 14:29
4
answers

Passing by JavaScript value

I have two objects: A and B: var A={valor:0} var B={valor:0} A=B A.valor=5 console.log(B.valor) // 5 I would like to know how to pass by value, since JavaScript passes by reference to objects, in this example I would like b.valor to...
asked by 15.03.2018 / 19:34