• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
Oh damn, I guess that's the last time I buy a domain from those commie bastards.
[QUOTE=Poo Monst3r;42906073]Oh damn, I guess that's the last time I buy a domain from those commie bastards.[/QUOTE] One of us, one of us!
[QUOTE=Poo Monst3r;42905651]OK So I figured out my problem above, which is that for some reason when I define a variable outside of the drawChart() function, it is not carried into the function. I've tried defining the DataTable variable 3 different ways: [CODE] var data = []; data[0] = new google.visualization.DataTable(); data[0].addColumn('string', 'Date'); // etc... [/CODE] [CODE] var window.data = [] window.data[0] = new google.visualization.DataTable(); window.data[0].addColumn('string', 'Date'); // etc... [/CODE] And then when I finally decided to define the DataTable var inside the drawChart function, it [I]finally[/I] decided to work: [CODE] function drawChart() { var data = [] data[0] = new google.visualization.DataTable(); data[0].addColumn('string', 'Date'); // etc... } [/CODE] Does [B]anyone[/B] know why JavaScript won't let me define a global var outside the drawChart function? [editline]18th November 2013[/editline] Another weird thing that I just found is that I can define a plain text variable outside the function, and I will be able to call it from within the function, but none of these DataTable objects are carrying through to the function.[/QUOTE] If anyone knows anything about this, it would so so so so so helpful to me. If you need clarification or more information, just ask. I have been stuck on this problem since Thursday and it is killing me slowly from the inside out. The full code might help also, so I'm going to post it: [CODE] <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type = 'text/javascript'> google.load("visualization", "1", {packages:["corechart"]}); google.setOnLoadCallback(drawChart); // Default graph drawn /***********************************/ /***********************************/ /********** GLOBAL VALUES **********/ /***********************************/ /***********************************/ var button = document.getElementById('unique'); var current = 0; /*******************************/ /********** DATA TABLES ********/ /*******************************/ /*******************************/ /***** VIEWS DATA TABLE *****/ /*******************************/ var window.data = []; window.data[0] = new google.visualization.DataTable(); window.data[0].addColumn('string', 'Date'); window.data[0].addColumn('number', 'Visits'); <?php /***** ECHOING ARRAY TO DATA TABLE FOR CHART *****/ $looper = 0; foreach ($visitsOverTime as $dated => $stuff) { if ($looper != 0) { ?> window.data[0].addRow(['<?php echo($dated); ?>', <?php echo($stuff); ?>]); <?php } $looper++; } ?> /**** END VIEWS DATA TABLE *****/ /*******************************/ /***** VIEWS vs UNIQUE DATA TABLE *****/ /*******************************/ window.data[1] = new google.visualization.DataTable(); window.data[1].addColumn('string', 'Date'); window.data[1].addColumn('number', 'Visits'); window.data[1].addColumn('number', 'Unique'); <?php /***** ECHOING ARRAY TO DATA TABLE FOR CHART *****/ $looper = 0; foreach ($visitsOverTime as $dated => $stuff) { if ($looper != 0) { ?> data[0].addRow(['<?php echo($dated); ?>', <?php echo($stuff); ?>, <?php echo($uniqueOverTime[$dated]); ?>]); <?php } $looper++; } ?> /**** END VIEWS vs UNIQUE DATA TABLE *****/ function drawChart() { // Create and draw the visualization. /*******************************/ /************ OPTIONS **********/ /*******************************/ // Set chart options var options = { backgroundColor: 'transparent', colors: ['#4ab0ce', '#56bc76'], pointSize: 10, lineWidth: 5, theme: 'maximized', curveType: 'function', // Tooltip hover event text styling tooltip: { textStyle: { color: '#000' }, showColorCode: 'true'}, // Legend position and color legend: { textStyle: { color: '#d8d8d8'}, position: 'in'}, // Title text styling titleTextStyle: { color: '#FFF'}, // Vertical axis styling vAxis: { textStyle: { color: '#d8d8d8', fontSize: 11}, baselineColor: '#8c8c8c', gridlines: { count: 10, color: '#8c8c8c'}}, // Horizontal axis styling hAxis: { textStyle: { color: '#d8d8d8', fontSize: 10}, gridlines: { count: 10, color: '#8c8c8c'}}, animation: { duration: 1000, easing: 'out'} }; var chart = new google.visualization.LineChart(document.getElementById('chart_div')); chart.draw(window.data[0], options); // Chart resize function (on window resize) $(document).ready(function () { $(window).resize(function() { chart.draw(window.data[0], options); }); }); } </script> [/CODE]
[QUOTE=ichiman94;42904392]Which PHP Framework should I use?[/QUOTE] Uh..Laravel? Kinda depends on what you want to do, really.
Would any lovely gentleman be kind enough to critique my first website? Pm me if you're up to the challenge (don't want to post it here incase the code gives people aneurisms)
What are the best resources to learn JavaScript?
[QUOTE=XxThreedogxX;42908543]What are the best resources to learn JavaScript?[/QUOTE] I used [url]https://developer.mozilla.org/en-US/[/url] a lot.
[QUOTE=jung3o;42908557]I used [url]https://developer.mozilla.org/en-US/[/url] a lot.[/QUOTE] Thanks mate. Would JavaScript be useful to create a browser based Text Adventure?
[QUOTE=XxThreedogxX;42908631]Thanks mate. Would JavaScript be useful to create a browser based Text Adventure?[/QUOTE] It's pretty much your only chance if you want it to be useable clientside.
I buy my domains through GoDaddy then transfer them to my host.
I'm about to buy a domain at name.com, however when submitting they want a phone verification so they need to call me with a 4 digit code for me to enter. Do I get charged for this? Because, phone from country to country is quite expensive. :suicide:
Why use name.com? and not one of the thousand other domain resellers who don't have such requirements? (But AFAIK you can never be charged for incomming calls... Unless you are roaming, in which case all calls would have a roaming fee)
[QUOTE=reeferdk;42913287]Why use name.com?[/QUOTE] Why not?
Because you don't need their crappy hosting services? Because you can get around that phone call by picking any other vendor?
This doesn't make ANY SENSE!!! I'm copying and pasting code from Google tutorials now and it's not even working!! [CODE] <!DOCTYPE html> <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type = 'text/javascript'> var options = { width: 400, height: 240, vAxis: {minValue:0, maxValue:1000}, animation: { duration: 1000, easing: 'out' } }; var chart = new google.visualization.ColumnChart( document.getElementById('chart_div')); var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'; var data = new google.visualization.DataTable(); data.addColumn('string', 'x'); data.addColumn('number', 'A'); data.addColumn('number', 'B'); data.addRow(['A', 123, 40]); data.addRow(['B', 17, 20]); var addButton = document.getElementById('unique'); function drawChart() { // Disabling the buttons while the chart is drawing. addButton.disabled = true; google.visualization.events.addListener(chart, 'ready', function() { // Enabling only relevant buttons. addButton.disabled = (data.getNumberOfColumns() - 1) >= chars.length; }); chart.draw(data, options); } function shuffleAndDrawChart() { for (var i = 0; i < data.getNumberOfRows(); ++i) { for (var j = 1; j < data.getNumberOfColumns(); ++j) { var num = Math.floor(Math.random() * 1000); data.setValue(i, j, num); } } drawChart(); } addButton.onclick = function() { data.addColumn('number', chars[data.getNumberOfColumns() - 1]); shuffleAndDrawChart(); } drawChart(); </script> [/CODE] How could this not work!??! It's taken directly from [URL="https://developers.google.com/chart/interactive/docs/animation#Transition_Behavior"]here[/URL]. I am so desperate now. [editline]19th November 2013[/editline] It's got something t do with variable scope, since it only ever works when all the variables are define within the drawChart() function, but I am completely out of ideas on how to fix it!!
[QUOTE=StinkyJoe;42906963]Uh..Laravel? Kinda depends on what you want to do, really.[/QUOTE] Thank you for the Laravel. I recently got interested in developing with php once I started with creating my own Wordpress themes. I wanted a general purpose framework that is simple and clean, just like Laravel. Now I'm going to try out some stuff AJAX and all that cool beans we can have. Thanks again. Do you have any starting tips/advice with these things?
[QUOTE=reeferdk;42913861]Because you don't need their crappy hosting services? Because you can get around that phone call by picking any other vendor?[/QUOTE] That's not enough reason to not buy at a specific place if I like it? Also: [IMG]http://i41.tinypic.com/28s52ts.png[/IMG] Seriously? Getting butthurt for getting a dumb rating, I didn't disagree I just geniunely thought your comment on me buying at name.com was dumb.
I didn't say that buying from name.com was dumb. I just wondered why you didn't pick one of the thousands of other vendors, if you had doubts about the ordering procedure. Maybe my former statements was dumb, honestly I don't know wether their hosting is "crappy", but I have never encountered a managed host that I was satishfied with, hence the prejudice.. Maybe you had experience with them as a hosting provider and could elaborate why it wasn't crappy, instead of just rating. Here is one reason not to use name.com (Well, at least not their DNS servers) [url]http://www.destructuring.net/2013/02/28/name-com-is-doing-some-really-sketchy-stuff/[/url] Probably more reasons. But whatever, you made up your mind.
[QUOTE=reeferdk;42923033]I didn't say that buying from name.com was dumb. I just wondered why you didn't pick one of the thousands of other vendors, if you had doubts about the ordering procedure.[/QUOTE] I didn't have doubts, I just never encountered a phone call from another country before and was no sure if they would charge for it. Also I didn't say you were dumb. And lastly name.com is one of those thousand vendors? But they didn't accept my card so I went with namecheap, happy? :v: [editline]20th November 2013[/editline] Oh well being unsure will count as a doubt, but I meant in the way that I never seen it before so I just had to make sure. Once I made sure I didn't have any doubts.
[QUOTE=ichiman94;42904392]Which PHP Framework should I use?[/QUOTE] My cousin talks about Symfony all the time. (He's been working with this for years - too many imo)
So Netbeans autocompletes variable names, and this happens [IMG]http://i.imgur.com/Fzpekk1.png[/IMG] Does anyone know how to disable this feature?
How to protect my "application" Web based application using xmlhttp to grab json from a php backend. The pages are built entirely in javascript so its faster and gives the user more control (also easier on the server) It is/will be a commercial product so I need to consider some way to protecting it from being stolen. Since the vast majority of the code is clientside there is a risk of our competitors stealing the source and claiming it as their own. Options as far as I can work out: Obfuscate code - would this stop people from trying to steal it? Only give script once they are authed Just stick a copyright notice on it and hope noone does steal it. I really don't want to move it all to the server since it would be a fair amount of work + much slower + php is awful
[QUOTE=mdeceiver79;42935745]the vast majority of the code is clientside[/QUOTE] There is no way to protect clientside code, sadly. I'd reccomend doing most of it in php or ruby, then just use ajax to get things from the backend.
[QUOTE=gokiyono;42935532]So Netbeans autocompletes variable names, and this happens [IMG]http://i.imgur.com/Fzpekk1.png[/IMG] Does anyone know how to disable this feature?[/QUOTE] That only occurs if you press enter on the dropdown, we learned to press escape. Quite, dumb yea. Sublime all the way :v:
[QUOTE=mdeceiver79;42935745]How to protect my "application" Web based application using xmlhttp to grab json from a php backend. The pages are built entirely in javascript so its faster and gives the user more control (also easier on the server) It is/will be a commercial product so I need to consider some way to protecting it from being stolen. Since the vast majority of the code is clientside there is a risk of our competitors stealing the source and claiming it as their own. Options as far as I can work out: Obfuscate code - would this stop people from trying to steal it? Only give script once they are authed Just stick a copyright notice on it and hope noone does steal it. I really don't want to move it all to the server since it would be a fair amount of work + much slower + php is awful[/QUOTE] fyi what you're doing right now is outright retarded Just scrap PHP entirely and use [url=http://nodejs.org]Node[/url] if you're that adamant about coding in JavaScript.
- snip -
[QUOTE=jetboy;42940817]fyi what you're doing right now is outright retarded Just scrap PHP entirely and use [url=http://nodejs.org]Node[/url] if you're that adamant about coding in JavaScript.[/QUOTE] My employer insists on it being php. Why is it retarded. Doing work on clientside means less work for server, faster page loading, more interactive. Doing work serverside: Send user page, user applies filter, send page again, user applies another filer, send page again, user orders data, send page again. Doing work clientside: Send user page, user applies filter use that data to rebuild page without the server. Its so much faster. I would love to use node but I don't have any options in that respect.
[QUOTE=mdeceiver79;42945384]My employer insists on it being php. Why is it retarded. Doing work on clientside means less work for server, faster page loading, more interactive. Doing work serverside: Send user page, user applies filter, send page again, user applies another filer, send page again, user orders data, send page again. Doing work clientside: Send user page, user applies filter use that data to rebuild page without the server. Its so much faster. I would love to use node but I don't have any options in that respect.[/QUOTE] Can I ask, what is it supposed to be?
[QUOTE=gokiyono;42945582]Can I ask, what is it supposed to be?[/QUOTE] Multisite real time reporting for epos, for now will just be sales with some forms for cash declarations. Once released more modules will be added for loyalty, stocks etc. The users will have an overview of events that day then be able to quickly filter and drill down on events and transactions for full details. edit: also an alert feed flagging suspect events, similar to facebook notifications.
Please can someone let me know their feedback and recommendations for improvement for this website, [url]www.joketwist.com[/url]. Thank you
Sorry, you need to Log In to post a reply to this thread.