![]() |
|
Re: Learning Javascript Thread
Two JavaScript programmers walk into a bar and immediately begin arguing with each other. Meanwhile, an Io and a Erlang programmer are sitting next to each other at the bar laughing their asses off.
|
Re: Learning Javascript Thread
Haha I just laughed pretty hard at that
|
Re: Learning Javascript Thread
Hello Everyone,
Can someone explain what the script should look like for the event "activate" in scrollspy found in Bootstrap here: http://twitter.github.com/bootstrap/...html#scrollspy? This is the event that highlights the links as you scroll through the content on a page. I have been searching and trying different scripts but cannot nail it. I am very new to JS. Thanx if you are able to answer! |
Re: Learning Javascript Thread
Quote:
|
Re: Learning Javascript Thread
It's been years since I bought a programming book. But I usually found the Cookbooks were pretty useful when learning a new language.
|
Re: Learning Javascript Thread
Quote:
assuming you have jquery |
Re: Learning Javascript Thread
I want to bump this old flamewar just to point out that having started getting more heavily into JS/JS frameworks the last few weeks, like 1/2 of the tutorials/stackoverflow questions seem to be in coffeescript. I can follow it well enough, but I do need to sit down and learn it, because it seems like it's becoming more widely spread. It also does look simpler and at least for me, less different from ruby/rails.
Also, front end has become way more fun since I started messing around with backbone. It's also fun to structure all my rails controllers/models to be restful APIs, as a bit of a different challenge. |
Re: Learning Javascript Thread
Rendering HTML client-side is a challenging, fun and rewarding experience. There are certainly perils that come with it. Testing and performance are two that come to mind.
I'm glad to see you're learning/getting into CoffeeScript, though. A similar framework to Backbone, but written in CoffeeScript, is Spine. I wouldn't recommend using it due to it not being actively maintained, but reading its source code can be quite enlightening. http://www.spinejs.com/docs/index |
Re: Learning Javascript Thread
I've been learning and working with Angular lately, I'm really enjoying it. The API is pretty clean, good documentation, not a lot of boilerplate, good run time performance = pretty awesome combo.
|
Re: Learning Javascript Thread
Code:
var TodoList = Backbone.Collection.extend({ |
Re: Learning Javascript Thread
Quote:
I wouldn't call the documentation good though... but there's quite a solid community behind it so stackoverflow and blog posts can get you through most things. |
Re: Learning Javascript Thread
Quote:
|
Re: Learning Javascript Thread
right. I was just confused because I think of apply and call as being used to control the value of "this" and seeing it used just to pass in an array of arguments looked odd.
|
Re: Learning Javascript Thread
I have been following the Javascript is Sexy post (too lazy to link). So far, so good. It recommends Professional Javascript if you have any programming knowledge and I would agree with that. It is a good book.
|
Re: Learning Javascript Thread
Am trying to come up with a medium-level difficulty JS project. Any ideas / inspiration?
Maybe a todo list? Also, whenever I look up AJAX info I always run into this: XMLHttpRequest But when I look up how to incorporate AJAX into Rails, the syntax is totally dif...usually something like: $.ajax { :url => '/rankings', :type => 'get' :data => 'json'} Any idea what this is about? It has me pretty confused since it doesn't mention XMLHttpRequest at all... |
Re: Learning Javascript Thread
$.ajax is doing an XMLHttpRequest under the covers.
|
Re: Learning Javascript Thread
ahh
|
Re: Learning Javascript Thread
backbone question,
Drupal is a bit special and expects some attributes to be in nested arrays like this, Code:
model_property[und][0][value] = "some model value" |
Re: Learning Javascript Thread
Are those really nested sequential arrays or just objects (or a combo)? Can you be a bit more specific as to the problem?
FYI - model_property['something'][0]['somevalue'] is the same as model_property.something[0].somevalue |
Re: Learning Javascript Thread
Sorry, I wasn't clear. The property['und'][0]['value'] is on the server side in php.
So on the client side I have a model with attributes like model.title = 'some title', model.content = 'some content'. But on the server side it expects a json object like, Code:
{from Code:
if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {Code:
if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {I just realized it wasn't failing validation I was just adding properties to a string object. :\ |
Re: Learning Javascript Thread
Quote:
|
Re: Learning Javascript Thread
Quote:
http://api.jquery.com/jQuery.ajax/ |
Re: Learning Javascript Thread
this is perfect, didnt realize it was a subset of jquery for some reason
thanks a ton! |
Re: Learning Javascript Thread
So as of right now, I have a JSON object coming back from my AJAX request. I'm trying to use jQuery to append info from this JSON object but, instead of doing that, it simply prints the JSON object to the screen (looks like an array of strings)...
Code:
$('#rankings_link').click(function(){ |
Re: Learning Javascript Thread
JSON/javascript objects don't have a length, you're thinking of an array. turn your json object into an array value so that you iterate through it.
|
| All times are GMT -4. The time now is 08:22 PM. |
|
Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 2008-2020, Two Plus Two Interactive