Author Topic: Anyone else here believe that js was made to make their life hell?  (Read 2343 times)

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
And i'm not talking about using noscript, i'm talking about actually using the thing... It seems that EVERY time i attempt to use javascript on my pages the function doesn't work. I get people to look it over, it doesn't work. They say it should, they can't explain it, it just doesn't work. I check to see if anything's going on and nothing's going on. I put alerts in my code to see if it's supposedly doing what it's supposed to on load, and well honestly that works. Then i remove them and try to click a link that's supposed to call a function and nothing.

This has been happening to me for as long as i can remember back, and it leads me to believe that javascript hates me with every nuance of it's code. Everything i try to do never works, and it all magically can't be explained. Outside helps says "well it's all set up right i don't get why it's not working".

So i was just wondering how many other people are pretty much unable to use javascript b/c even with a debugger nothing works and no errors show up.

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #1 on: February 12, 2010, 05:04:07 AM »
Quote
Anyone else here believe that js was made to make their life hell?
On the contrary. I believe it was made to make my life easier by crushing the competition. I just decided to not use JS except for really trivial implementations, this gives me a competitive advantage over those who spend time & resources on making JS working :D

Offline stpinker

  • Level 4
  • *
  • Posts: 12
  • Reputation: +0/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #2 on: February 12, 2010, 06:26:17 AM »
133794m3 ... Javascript is reacting to your emotions toward him ( or her ) ...

If you love js then js will love you in return. Kind of the mystico-religious side of programming.
Philosophy:
         When you hate something you attract hate from it.

Science:
        When you despise a programming language you usually make lots of stupid little typos that are almost invisible and you keep looking the wrong place for it.

That explains why you have probs with js and and not me.

I tend to love all programming language but I do have my preferences. But when a tool is there you would be dumb to not learn to use it properly.

Regards,
Stpinker  :D

Online raestlyn

  • Level 29
  • **
  • Posts: 464
  • Reputation: +9/-5
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #3 on: February 12, 2010, 06:41:51 AM »
I like javascript. My next game project will only be OOP javascript and SQlite as a db. Yes, even on serverside.


I can send you pics of my cocks if you want reference.


Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #4 on: February 12, 2010, 06:44:40 AM »
133794m3 ... Javascript is reacting to your emotions toward him ( or her ) ...

If you love js then js will love you in return. Kind of the mystico-religious side of programming.
Philosophy:
         When you hate something you attract hate from it.

Science:
        When you despise a programming language you usually make lots of stupid little typos that are almost invisible and you keep looking the wrong place for it.

That explains why you have probs with js and and not me.

I tend to love all programming language but I do have my preferences. But when a tool is there you would be dumb to not learn to use it properly.

Regards,
Stpinker  :D

I went into this with an open mind, i love what javascript can do it's an extremely powerful scripting language. And i doubt all of my stupid little typos as i'm currently attempting to use the jquery api. So all i did was run the function they told me to. I had a guy who helped me over there and he was unable to figure out why in the world it wasn't working. It just refuses to work, i have no idea why. It's just that javascript refuses to work for me. I've tried everything i can. And i doubt it's being dumb if you spend a couple weeks attempting to figure out why one function isn't working. Even though you set it up correctly, and you checked over the function you're calling a billion times and it still doesn't work.

edit:I was goign to use it for a very simple reason. It looks amazing, i type it properly, and it's supposed to work. That's the plain point of it all, it's supposed to be working but doesn't. Javascript's amazing, but if IT refuses to work, i'll not use it. The amount of time i've wasted thus far attempting to get the thing to work, could've been spent other places and i've actually had gotten something done.
« Last Edit: February 12, 2010, 06:46:23 AM by 133794m3r »

Offline lolninja

  • Level 19
  • *
  • Posts: 194
  • Reputation: +5/-0
  • BSc powered Programmer
    • View Profile
    • HTTPmmo
Re: Anyone else here believe that js was made to make their life hell?
« Reply #5 on: February 12, 2010, 06:56:40 AM »
The only thing I can think that would break Javascript is that your server isn't serving the Javascript with the correct mime type, check its being served as text/javascript, if that doesn't work then I've no idea without seeing some code.

Imho Javascript is the most awesome thing ever, to the point where I'm considering dropping my current weekend-development project and starting to learn node.js which looks totally awesome btw :D

Offline Chris

  • Game Owner
  • Level 35
  • *
  • Posts: 2,217
  • Reputation: +28/-1
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #6 on: February 12, 2010, 06:57:46 AM »
I tend to love all programming language but I do have my preferences. But when a tool is there you would be dumb to not learn to use it properly.
I tend to love only one programming language at any given moment and hate the rest during that time. It results in a more intensified love and the love is returned to me by superior coding speed in the Only True Love language :)

stpinker, you... you unmoral polygamist :D


Sanitity... It is such scarce resource among us coders...

Online raestlyn

  • Level 29
  • **
  • Posts: 464
  • Reputation: +9/-5
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #7 on: February 12, 2010, 07:08:03 AM »
133794m3 ... Javascript is reacting to your emotions toward him ( or her ) ...

If you love js then js will love you in return. Kind of the mystico-religious side of programming.
Philosophy:
         When you hate something you attract hate from it.

Science:
        When you despise a programming language you usually make lots of stupid little typos that are almost invisible and you keep looking the wrong place for it.

That explains why you have probs with js and and not me.

I tend to love all programming language but I do have my preferences. But when a tool is there you would be dumb to not learn to use it properly.

Regards,
Stpinker  :D

I went into this with an open mind, i love what javascript can do it's an extremely powerful scripting language. And i doubt all of my stupid little typos as i'm currently attempting to use the jquery api. So all i did was run the function they told me to. I had a guy who helped me over there and he was unable to figure out why in the world it wasn't working. It just refuses to work, i have no idea why. It's just that javascript refuses to work for me. I've tried everything i can. And i doubt it's being dumb if you spend a couple weeks attempting to figure out why one function isn't working. Even though you set it up correctly, and you checked over the function you're calling a billion times and it still doesn't work.

edit:I was goign to use it for a very simple reason. It looks amazing, i type it properly, and it's supposed to work. That's the plain point of it all, it's supposed to be working but doesn't. Javascript's amazing, but if IT refuses to work, i'll not use it. The amount of time i've wasted thus far attempting to get the thing to work, could've been spent other places and i've actually had gotten something done.
What does your FireBug or FF error console say about the problem?


I can send you pics of my cocks if you want reference.


Offline stpinker

  • Level 4
  • *
  • Posts: 12
  • Reputation: +0/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #8 on: February 12, 2010, 07:09:31 AM »
I tend to love all programming language but I do have my preferences. But when a tool is there you would be dumb to not learn to use it properly.
I tend to love only one programming language at any given moment and hate the rest during that time. It results in a more intensified love and the love is returned to me by superior coding speed in the Only True Love language :)

stpinker, you... you unmoral polygamist :D


Sanitity... It is such scarce resource among us coders...

But I must add the reproductive and mutation rate is far greater in polygamy !!

EDIT: PHP and JS make nice childs :)

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #9 on: February 12, 2010, 07:14:41 AM »
133794m3 ... Javascript is reacting to your emotions toward him ( or her ) ...

If you love js then js will love you in return. Kind of the mystico-religious side of programming.
Philosophy:
         When you hate something you attract hate from it.

Science:
        When you despise a programming language you usually make lots of stupid little typos that are almost invisible and you keep looking the wrong place for it.

That explains why you have probs with js and and not me.

I tend to love all programming language but I do have my preferences. But when a tool is there you would be dumb to not learn to use it properly.

Regards,
Stpinker  :D

I went into this with an open mind, i love what javascript can do it's an extremely powerful scripting language. And i doubt all of my stupid little typos as i'm currently attempting to use the jquery api. So all i did was run the function they told me to. I had a guy who helped me over there and he was unable to figure out why in the world it wasn't working. It just refuses to work, i have no idea why. It's just that javascript refuses to work for me. I've tried everything i can. And i doubt it's being dumb if you spend a couple weeks attempting to figure out why one function isn't working. Even though you set it up correctly, and you checked over the function you're calling a billion times and it still doesn't work.

edit:I was goign to use it for a very simple reason. It looks amazing, i type it properly, and it's supposed to work. That's the plain point of it all, it's supposed to be working but doesn't. Javascript's amazing, but if IT refuses to work, i'll not use it. The amount of time i've wasted thus far attempting to get the thing to work, could've been spent other places and i've actually had gotten something done.
What does your FireBug or FF error console say about the problem?

Nothing what so ever... it doesn't show any errors, it also doesn't show the ajax calls. I was using wamp server and i specifically said put this in my header.
Code: [Select]
<script src="scripts/jquery-1.4.1.js" type="text/javascript"></script> The code i was attempting to do was their "load()" api. I made sure it was set properly, and i have no errors but it's not going for some odd reason.

Online raestlyn

  • Level 29
  • **
  • Posts: 464
  • Reputation: +9/-5
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #10 on: February 12, 2010, 07:17:40 AM »
Can you show me the code and I'll fix it for you. I have played around with jQuery long enough to see when it just doesn't work.


I can send you pics of my cocks if you want reference.


Offline dsheroh

  • Level 21
  • *
  • Posts: 235
  • Reputation: +6/-0
  • Perl Vicar
    • View Profile
    • Psi Rangers
Re: Anyone else here believe that js was made to make their life hell?
« Reply #11 on: February 12, 2010, 07:28:45 AM »
133794m3 ... Javascript is reacting to your emotions toward him ( or her ) ...

If you love js then js will love you in return. Kind of the mystico-religious side of programming.

Ah, but is it better to be loved or feared?

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Anyone else here believe that js was made to make their life hell?
« Reply #12 on: February 12, 2010, 09:37:56 AM »
I thought JavaScript was a weird and broken language until I read the book JavaScript: The Good Parts. I've got a longer review on my blog, but in short: it makes sense of the language. Add tools like jQuery and Firebug, and it's pretty nice to develop in.

Post your code, there's enough jQuery fans around to fix it. Or ask in #jquery on irc.freenode.net, lots of helpful folks there.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #13 on: February 12, 2010, 10:37:22 AM »
I thought JavaScript was a weird and broken language until I read the book JavaScript: The Good Parts. I've got a longer review on my blog, but in short: it makes sense of the language. Add tools like jQuery and Firebug, and it's pretty nice to develop in.

Post your code, there's enough jQuery fans around to fix it. Or ask in #jquery on irc.freenode.net, lots of helpful folks there.
i did post the code... that's the exact bit of code that's refusing to work what so ever. I used jquery since it was an ajax api, and also b/c it was going to do what i wanted. Which was to make my life easier with javascript.

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Anyone else here believe that js was made to make their life hell?
« Reply #14 on: February 12, 2010, 11:08:24 AM »
[
i did post the code... that's the exact bit of code that's refusing to work what so ever. I used jquery since it was an ajax api, and also b/c it was going to do what i wanted. Which was to make my life easier with javascript.

You pasted the <script> tag to include jQuery and mentioned some code using load() but didn't give that code.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Sunchaser

  • Game Owner
  • Level 23
  • *
  • Posts: 296
  • Reputation: +3/-0
  • Game Owner
    • View Profile
    • Medieval Europe
Re: Anyone else here believe that js was made to make their life hell?
« Reply #15 on: February 12, 2010, 11:17:14 AM »
I just started using Jquery but did you add in the page

Code: [Select]
$(document).ready(function()
{
..
}

?

I found out the jquery script was simply not working if i didn't add this piece of code

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #16 on: February 12, 2010, 12:23:24 PM »
Can't it be that elements being the target of your script weren't created yet?
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #17 on: February 12, 2010, 12:51:43 PM »
oh ok woops sorry. it's kinda early...

Code: [Select]
$(document).ready(function () {
    $('a.mainpage').click(function (e) {
        e.preventDefault();
        $('#reusepanel').load('main/tos.php #tos', function () {
            $('#reusepanel').fadeIn();
        });
    });
 });

and the part that's supposed to be working with it :/

Code: [Select]
<a href="#" class="link" id="tos"> --Terms of Use Agreement-- </a>
I've also tried to do a <a href="javascript:function(){};" class="link" id="tos"> --Terms of Use Agreement-- </a>

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #18 on: February 12, 2010, 12:59:24 PM »
So what Firebug says? And which part works and which not?

There are surely a sophisticated ways but I use alert() to determine that, would like to learn debugging with Firebug too

Can't see anything wrong now...

For questions about JS it's often best to provide live example (link to the site or at least make example site)
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

Offline 133794m3r

  • Level 22
  • *
  • Posts: 265
  • Reputation: +2/-0
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #19 on: February 12, 2010, 01:07:14 PM »
So what Firebug says? And which part works and which not?

There are surely a sophisticated ways but I use alert() to determine that, would like to learn debugging with Firebug too

Can't see anything wrong now...

For questions about JS it's often best to provide live example (link to the site or at least make example site)
i have no hosting set up atm :/ so there is no site atm. And i did use the alert() before. And it does load the document as it is supposed to. Firebug says nothing. When i click on that link. I won't be having a live site until, i actually have something that needs testing to a live site. So until that time there's pretty much nothing... i can upload the .php documents but beyond that there's nothing.

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #20 on: February 12, 2010, 01:12:33 PM »
So the data are loaded successfully (and available in the success function), but fail to be injected into element although it exists?
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

Offline codestryke

  • Administrator
  • Level 33
  • *****
  • Posts: 589
  • Reputation: +22/-0
    • View Profile
    • eXtremeCast Games
Re: Anyone else here believe that js was made to make their life hell?
« Reply #21 on: February 12, 2010, 01:27:55 PM »
oh ok woops sorry. it's kinda early...

Code: [Select]
$(document).ready(function () {
    $('a.mainpage').click(function (e) {
        e.preventDefault();
        $('#reusepanel').load('main/tos.php #tos', function () {
            $('#reusepanel').fadeIn();
        });
    });
 });

and the part that's supposed to be working with it :/

Code: [Select]
<a href="#" class="link" id="tos"> --Terms of Use Agreement-- </a>
I've also tried to do a <a href="javascript:function(){};" class="link" id="tos"> --Terms of Use Agreement-- </a>

I haven't used jQuery that much so I'm just taking a guess. Are you sure you are suppose to prepend the # sign to the id with jQuery? With prototype and even straight javascript you just use the id's name. $('reusepanel').fadeIn();

Creating online addictions, one game at a time:

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #22 on: February 12, 2010, 01:31:28 PM »
Yes, you are, you use common CSS notation, this code would mean <reusepanel> tag
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

Offline Harkins

  • Level 28
  • **
  • Posts: 424
  • Reputation: +11/-2
  • Coder, blogger, entrepreneur.
    • View Profile
    • Push CX - Blog
Re: Anyone else here believe that js was made to make their life hell?
« Reply #23 on: February 12, 2010, 02:33:27 PM »
Your code looks just fine, except that $('a.mainpage') should probably be $('#tos') - the HTML snippet you give isn't a link with the 'mainpage' class.

Visit #bbg on irc.freenode.net to talk browser games anytime.

Offline Nox

  • Level 35
  • **
  • Posts: 768
  • Reputation: +12/-2
    • View Profile
Re: Anyone else here believe that js was made to make their life hell?
« Reply #24 on: February 12, 2010, 03:55:27 PM »
That's what I though at first, but the link he pasted is used in the load() function so and the a.mainpage probably does exist, just somewhere else

But all this would be solved easier with a live demo

....133794m3r (9=G?) what about freehost? or just gimme the codes and I could upload it for you
Meet us at an IRC irc.freenode.net #bbg as well
https://vimeo.com/36579366 (a must-watch) | Join BOINC - no longer a hype, but you can help never the less

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal