<--- is stupid,javascript will not enter my brain

C++, C#, Java, PHP, ect...
Post Reply
zvi5
Posts: 14
Joined: Sun Oct 31, 2010 9:24 am

<--- is stupid,javascript will not enter my brain

Post by zvi5 »

[center]any 1 have the keys?![/center]


I tried!, And again I tried!And even one more time!


but i just dont get it :(

and i know its super basic, and i want to get it working with php, and i want ajax, and all i have is a lot of will and the understaniding of "alert this and var that"


i get that part well =)

but how the snitzl am i suppose to get php incremented? ajax?! dont even start with me :(

tips?

thanx guys your a huge help...
have a great night =)
cake!

___zvi5__
PHP&SQL,HTML,CSS---"understander" :P
alexander19
Posts: 180
Joined: Fri Apr 02, 2010 1:05 pm

Re: <--- is stupid,javascript will not enter my brain

Post by alexander19 »

I had the same problem with it..did many tutorials and still couldnt learn a thing about js.
But then I saw jquery(a js library),which made js a lot easier to learn and it really helped me in the long run.
And for sending data from a php script to js you should use JSON which is more reliable and gives you a better control over the data you send.

Good Luck learning! ;)
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: <--- is stupid,javascript will not enter my brain

Post by Jackolantern »

Yep, the "key" is definitely jQuery. You do need to know at least the basics of vanilla Javascript before you start doing serious work with jQuery, but you don't need to know how to do complex page effects before learning jQuery. jQuery is how Javascript should have been.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: <--- is stupid,javascript will not enter my brain

Post by hallsofvallhalla »

i am not a great coder but I really have not had much issue with raw JS. The key for me was to use it in examples. Like use it as I built my game. It is not a super simple language so don't be hard on yourself.

They key to using it with PHP is building the variables

Code: Select all

var strength = <?php echo $playerinfo3['strength']; ?> ;
then using it to some value

Code: Select all

var randstrength = Math.floor(Math.random()*strength)
User avatar
Torniquet
Posts: 869
Joined: Sun Aug 02, 2009 6:18 am

Re: <--- is stupid,javascript will not enter my brain

Post by Torniquet »

i personally love jquery library. super simple to use and a fare few plugins to make things even simpler.

@halls.

burying php into js is ok, but you cant put it into external js scripts or into Obfuscated script.

i prefer to put any variables into hidden inputs then use the attr method to grab the value.

if you need any tips on using jquery ill be happy to help :)
New Site Coming Soon! Stay tuned :D
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: <--- is stupid,javascript will not enter my brain

Post by hallsofvallhalla »

when pulling must have queries in the start of the load it one of the safest ways to get it. PHP is far safer than Ajax or jquery.

I am actually learning Jquery now. Not too bad...I am starting to like. :)
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: <--- is stupid,javascript will not enter my brain

Post by Jackolantern »

hallsofvallhalla wrote: I am actually learning Jquery now. Not too bad...I am starting to like. :)
Come to the dark side. Once you get used to it, you would rather take a long walk down a short reactor shaft than write vanilla Javascript.
The indelible lord of tl;dr
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: <--- is stupid,javascript will not enter my brain

Post by hallsofvallhalla »

hehehehe
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: <--- is stupid,javascript will not enter my brain

Post by Chris »

Jackolantern wrote:Come to the dark side.
I've joined the dark side. Funny how against jQuery I was and now how much I rely on it now..
Fighting for peace is declaring war on war. If you want peace be peaceful.
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: <--- is stupid,javascript will not enter my brain

Post by Jackolantern »

Chris wrote:
Jackolantern wrote:Come to the dark side.
I've joined the dark side. Funny how against jQuery I was and now how much I rely on it now..
Holy crap! Chris is on with jQuery now! The rebels are doomed!
The indelible lord of tl;dr
Post Reply

Return to “Coding”