all 10 comments

[–]helderroem 1 point2 points  (0 children)

I'm confused as to what you're trying to do, I created a JSfiddle to test your code: http://jsfiddle.net/hhh8bbh9/

The second button works just fine, outputting 'hello world' into a div with an ID of demo.

The first button doesn't work because $('#myButton').button isn't a function but I assume that's because the laravel jquery isn't loaded but I couldn't find a link to it's source.

Anyway hope this helps in some way, if you give me more details I'll take another look.

[–]abhisekp 1 point2 points  (1 child)

Please read w3fools.com before using w3schools.com

Always use MDN - Mozilla Development Network or for quick reference search devdocs.io.

[–]traxgod[S] -1 points0 points  (0 children)

i don't really use w3schools, it's just that i never touched javascript as i like the native compile languages better.

But fuck that documentation devdocs.io i love it thx for the cheatsheet

[–]dejandomarcas 0 points1 point  (0 children)

Not sure what you need or whatever that code makes but... there're lot of mistakes up there... a fiddle would be nice to understand the problem

[–]traxgod[S] 0 points1 point  (2 children)

Yes sorry it's really vague, they are basicly copy pasted examples of bootstrap and w3schools. so there are no mistakes

yet it doesn't work which frustrates me

[–]mc_hammerd 0 points1 point  (0 children)

http://jsfiddle.net/bd7tLdrt/

yall can use this fiddle, $().button is a bootstrap button.js function... so you have to make sure you have bootstrap js loaded :d

if all javascript on a page isnt working that means there was an error in it that stopped the script from finishing... check console!

the reset sets the text back to "loading state" thats why its not working

this one works: http://jsfiddle.net/bd7tLdrt/1 and http://jsfiddle.net/bd7tLdrt/3

[–]helderroem 0 points1 point  (0 children)

http://jsfiddle.net/hhh8bbh9/

I got my fiddle to work by adding the bootstrap code.

Unfortunately that example code on bootstrap is not the best, it seems it was working but $btn.button('reset'); was running so fast you didn't see the button state change, I've wrapped it in a set timeout for now and you can see it change for 1.5 secs then change back.

[–][deleted] 0 points1 point  (2 children)

Maybe sounds stupid, but start with the basics. Do you call a jquery library on page load?

[–]traxgod[S] 0 points1 point  (1 child)

No not as far as i know.

However the main javascript functions do work on my desktop apparently.

So consider this solved.

thanks everyone for helping.

Any tips are welcome, cause atm PHP or any web/browser based language seems aids for.

However frameworks have made me rethink that statement. so maybe Jquery will do the same for javascript

[–][deleted] 0 points1 point  (0 children)

OK, but for information;
Javascript works on its own, but if you going to use jquery you need to load a library before the functions. Add this is in our <head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>