Posts by teliz • 676 points
31 posts
-
0
votes1
answer193
viewsA: How do I upload php file correctly when it has special characters or accents?
An interesting approach is to create a hash using MD5 to be the file name in your directory and save it in the database linking to the real name (with accents and special characters) echo…
-
1
votes4
answers302
viewsA: getElementById not working
In case you really need your document.getElementById be a string and wish to run it in your code, you must use the eval() in his Javascript. var teste = 'olha'; eval("console.log(teste)") Reference…
javascriptanswered teliz 676 -
4
votes2
answers35879
viewsA: No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'null' is therefore not allowed access. - Phonegap
If you don’t have access to the server to add headers: You can use one of the extensions for Chrome (for development): Allow-Control-Allow-Origin: * CORS Toggle These extensions disable Chrome…
-
2
votes2
answers51
viewsA: Only stylize if the element belongs to a class
Just add the respective class and its style: .fa-book.status{ color:tomato; } .fa-home.status{ color:green; } .fa-pencil{ color:blue; } <script…
-
2
votes2
answers1176
viewsA: Generate a JSON from a converted XML with Javascript
"play the contents of this string in a.json file" You nay can save because the script is running on the client, for security reasons you do not have access to automatically save files on it. You…
-
3
votes1
answer235
viewsA: Alphabetical order on While?
If you cannot change in your SQL query (recommended) SELECT * FROM `tabela` ORDER BY `nome` ASC 8.2.1.13 ORDER BY -- You can use the Sort() $fruits = array("lemon", "orange", "banana", "apple");…
-
1
votes3
answers51
viewsA: Interpret data from an external file to use in Autocomplete
Your problem is in the form of data: [Depósito de Teste , teste, ] Must contain quotes or apostrophe. var teste = ["Depósito de Teste" , "teste", ]; Use json_encode for your php to return* in the…
-
2
votes1
answer838
viewsA: Delete Label text with jquery
Add an ID to the label <label id="label-justificativa">Justificativa: </label> Add to your js $("#label-justificativa").remove(); -- I think it might improve your code: function…
-
1
votes1
answer17
viewsA: problem with a run function when clicked enter
The keyCode 13 is for the [enter] $(document).on('keydown', function(event) { if(event.keyCode === 13) { // código aqui } });
javascriptanswered teliz 676 -
4
votes1
answer60
viewsA: How does javascript 'e' work?
Use is just a short Event. You can pass any variable name you want. $('#myTable').click(function(anyothername) { var clicked = $(anyothername.target); }); You can check more about the treatment of…
-
0
votes2
answers49
viewsA: Start my fullscreen Chrome app
chrome.windows.update(windowId, { state: "fullscreen" }) Behold: http://developer.chrome.com/extensions/windows.html#method-update…
-
0
votes3
answers710
viewsA: Read json via http by Angularjs
A brief explanation of why this happens. I use this plugin for DEV when I can’t edit the API server settings. Moesif Origin & CORS Changer recalling that in production in the case of hosts…
-
0
votes3
answers791
viewsA: Change the Background-color of a div within a link
Would use the RGB instead of RGBA (because in the example you don’t need the Alpha) background-color: rgb(0, 0, 255); -- Would use a transition so the effect is softer: example transition:…
-
2
votes1
answer245
viewsA: PHP in production with Composer
You can use: composer.phar install --no-dev or composer.phar install --no-dev --optimize-autoloader (it generates a class map that will speed up automatic loading in your application). I hope I’ve…
-
4
votes2
answers509
viewsA: jQuery apply function to all div with the same name
I would use each() $('div').each(function(){ //Código da função }); I hope I’ve helped.
-
0
votes1
answer664
viewsA: How to resolve XAMMP virtual host "Access Forbidden!" error in MAC OS Sierra 10.12.6?
I do not use XAMPP but I suspect it is the non-specification of AllowOverride following example: <VirtualHost *:80> ServerName meusite.local DocumentRoot "F:\Projets\Web\site" DirectoryIndex…
-
1
votes1
answer137
viewsA: Logical reasoning for checkout virtual store purchases
I would particularly use a new table: pedidos id_user id_product ... status As such, when the user logs in you check if he has an order with pending status and puts the items in his cart. I hope…
-
1
votes1
answer173
viewsA: Save value from a select and display
The problem is that you are only listing the data from select, and not define which item will be selected from <option> using the selected, example: <select> <option…
-
4
votes2
answers446
viewsA: PHP in Browser Write , Read and Update . txt , Locally
I believe that is not possible , because your PHP code is on a server outside the directory where you want to make file modifications, so the browser cannot make the change.
-
-1
votes4
answers781
viewsA: HTML/PHP Detect if form value has been changed
I suggest using token: Once the user logs in, you generate the token and save it to the BD and session. $token = md5(uniqid(rand(), true)); When logging out you remove the BD token and so the user…
-
1
votes4
answers905
viewsA: Changing the background of a table
Hello, I made a basic example using jquery. https://jsfiddle.net/telizpablo/5rfn0kbp/3/ in the attribute data-color you define the color that that div will transform to table2 (can be HEX too ) ;) I…
-
0
votes1
answer173
viewsA: How to use Auth::user()->id on route?
You instantiate the stab to the Auth:: ? using the stab wound: use Illuminate\Support\Facades\Auth; // receives the current user : $user = Auth::user(); // receives the current user id: $id =…
-
1
votes3
answers2143
viewsA: How to let Divs self-adjusting vertically?
I use the Masonry Installing by the Bower bower install masonry --save Or CDN <script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.js"></script> Using: Jquery…
-
0
votes2
answers9898
viewsA: Error "Content-Type is not allowed by Access-Control-Allow-Headers in preflight Response"
If you don’t have access to the server to add headers: You can use one of the extensions for Chrome (for development): Allow-Control-Allow-Origin: * CORS Toggle These extensions disable Chrome…
-
1
votes3
answers878
viewsA: How to Get JSON Data
Use it out of the <script src=""> <script language="JavaScript" src="teste.js" ></script> <script> document.getElementById("teste").innerHTML = pag_1.produto; </script>…
-
0
votes2
answers1401
viewsA: Convert image size before uploading PHP
I found something that might help you: compress-compress-image-upload But basically, you need to make a case to filter different extensions and use each imagecreatefrom*() to its respective extent:…
-
1
votes2
answers2987
viewsA: Load js function automatically and for various Ivs
You have to create events for such a thing to happen. With Jquery: $('#a').ready(function() { teste('lala'); }); $('#b').ready(function() { teste('papa'); }); $('#c').ready(function() {…
-
0
votes1
answer34
viewsA: Date format
I think it’s best to format it on the grid (HTML), if you want something more personalized, create a directive. <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss…
-
1
votes2
answers1062
viewsA: Node + Pokeapi "Error: connect ECONNREFUSED 127.0.0.1:443"
From what I’ve seen of your json options is in trouble. try: var options = { protocol: 'https', hostName: 'pokeapi.co', versionPath: '/api/v2/' }…
-
-1
votes2
answers1254
viewsA: Validate Laravel Single Field
Add in your HTML the values that are returned by the database. Ex: if I am editing the email field in the bank with value [email protected], in my HTML the field should come with [email protected]. So,…
-
1
votes1
answer66
viewsA: I can not send data from Angularjs to PHP
What I saw of wrong was: <button type="submit" id="btn_cont" class="btn btn-xl" ng-click="insertInfo();">Enviar mensagem</button> So you call the send function without parameters Should…